Add code, unknown original date
This commit is contained in:
347
code/q3_ui/.svn/all-wcprops
Executable file
347
code/q3_ui/.svn/all-wcprops
Executable file
@@ -0,0 +1,347 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 48
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui
|
||||
END
|
||||
ui_preferences.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 65
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_preferences.c
|
||||
END
|
||||
ui_mods.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 58
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_mods.c
|
||||
END
|
||||
ui_menu.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 58
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_menu.c
|
||||
END
|
||||
ui_display.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 61
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_display.c
|
||||
END
|
||||
ui_splevel.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 61
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_splevel.c
|
||||
END
|
||||
ui_servers2.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 62
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_servers2.c
|
||||
END
|
||||
ui_rankings.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 62
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_rankings.c
|
||||
END
|
||||
ui_playermodel.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 65
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_playermodel.c
|
||||
END
|
||||
ui_playersettings.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 68
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_playersettings.c
|
||||
END
|
||||
compile.bat
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 60
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/compile.bat
|
||||
END
|
||||
ui.q3asm
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 57
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui.q3asm
|
||||
END
|
||||
ui_serverinfo.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 64
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_serverinfo.c
|
||||
END
|
||||
ui_atoms.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 59
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_atoms.c
|
||||
END
|
||||
ui_main.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 58
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_main.c
|
||||
END
|
||||
ui_startserver.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 65
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_startserver.c
|
||||
END
|
||||
ui_gameinfo.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 62
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_gameinfo.c
|
||||
END
|
||||
ui_controls2.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 63
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_controls2.c
|
||||
END
|
||||
ui_qmenu.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 59
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_qmenu.c
|
||||
END
|
||||
ui_removebots.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 64
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_removebots.c
|
||||
END
|
||||
ui_specifyleague.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 67
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_specifyleague.c
|
||||
END
|
||||
ui_spreset.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 61
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_spreset.c
|
||||
END
|
||||
ui_sound.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 59
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_sound.c
|
||||
END
|
||||
ui_network.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 61
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_network.c
|
||||
END
|
||||
ui_confirm.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 61
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_confirm.c
|
||||
END
|
||||
ui_local.h
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 59
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_local.h
|
||||
END
|
||||
ui_rankstatus.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 64
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_rankstatus.c
|
||||
END
|
||||
ui_mfield.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 60
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_mfield.c
|
||||
END
|
||||
q3_ui.vcproj
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 61
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/q3_ui.vcproj
|
||||
END
|
||||
ui_loadconfig.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 64
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_loadconfig.c
|
||||
END
|
||||
ui_signup.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 60
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_signup.c
|
||||
END
|
||||
ui_teamorders.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 64
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_teamorders.c
|
||||
END
|
||||
ui_demo2.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 59
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_demo2.c
|
||||
END
|
||||
ui_video.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 59
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_video.c
|
||||
END
|
||||
q3_ui.bat
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 58
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/q3_ui.bat
|
||||
END
|
||||
ui_login.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 59
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_login.c
|
||||
END
|
||||
q3_ui.sh
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 57
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/q3_ui.sh
|
||||
END
|
||||
keycodes.h
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 59
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/keycodes.h
|
||||
END
|
||||
ui_cinematics.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 64
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_cinematics.c
|
||||
END
|
||||
ui_players.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 61
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_players.c
|
||||
END
|
||||
ui_addbots.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 61
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_addbots.c
|
||||
END
|
||||
ui_spskill.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 61
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_spskill.c
|
||||
END
|
||||
ui_sppostgame.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 64
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_sppostgame.c
|
||||
END
|
||||
ui_saveconfig.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 64
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_saveconfig.c
|
||||
END
|
||||
q3_ui.q3asm
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 60
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/q3_ui.q3asm
|
||||
END
|
||||
Conscript
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 58
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/Conscript
|
||||
END
|
||||
ui_team.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 58
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_team.c
|
||||
END
|
||||
q3_ui.dsp
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 58
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/q3_ui.dsp
|
||||
END
|
||||
ui_connect.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 61
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_connect.c
|
||||
END
|
||||
ui_sparena.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 61
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_sparena.c
|
||||
END
|
||||
ui_specifyserver.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 67
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_specifyserver.c
|
||||
END
|
||||
ui_options.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 61
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_options.c
|
||||
END
|
||||
ui.def
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 55
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui.def
|
||||
END
|
||||
ui_credits.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 61
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_credits.c
|
||||
END
|
||||
ui_syscalls.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 62
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_syscalls.c
|
||||
END
|
||||
ui_cdkey.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 59
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_cdkey.c
|
||||
END
|
||||
ui_ingame.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 60
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_ingame.c
|
||||
END
|
||||
ui_setup.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 59
|
||||
/svn/aklabs/!svn/ver/9/trunk/hypermod/code/q3_ui/ui_setup.c
|
||||
END
|
||||
1969
code/q3_ui/.svn/entries
Executable file
1969
code/q3_ui/.svn/entries
Executable file
File diff suppressed because it is too large
Load Diff
5
code/q3_ui/.svn/prop-base/Conscript.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/Conscript.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/compile.bat.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/compile.bat.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/keycodes.h.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/keycodes.h.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/q3_ui.bat.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/q3_ui.bat.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/q3_ui.dsp.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/q3_ui.dsp.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/q3_ui.q3asm.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/q3_ui.q3asm.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/q3_ui.sh.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/q3_ui.sh.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/q3_ui.vcproj.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/q3_ui.vcproj.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui.def.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui.def.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui.q3asm.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui.q3asm.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_addbots.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_addbots.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_atoms.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_atoms.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_cdkey.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_cdkey.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_cinematics.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_cinematics.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_confirm.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_confirm.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_connect.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_connect.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_controls2.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_controls2.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_credits.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_credits.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_demo2.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_demo2.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_display.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_display.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_gameinfo.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_gameinfo.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_ingame.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_ingame.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_loadconfig.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_loadconfig.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_local.h.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_local.h.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_login.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_login.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_main.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_main.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_menu.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_menu.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_mfield.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_mfield.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_mods.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_mods.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_network.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_network.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_options.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_options.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_playermodel.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_playermodel.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_players.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_players.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_playersettings.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_playersettings.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_preferences.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_preferences.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_qmenu.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_qmenu.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_rankings.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_rankings.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_rankstatus.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_rankstatus.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_removebots.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_removebots.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_saveconfig.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_saveconfig.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_serverinfo.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_serverinfo.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_servers2.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_servers2.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_setup.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_setup.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_signup.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_signup.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_sound.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_sound.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_sparena.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_sparena.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_specifyleague.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_specifyleague.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_specifyserver.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_specifyserver.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_splevel.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_splevel.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_sppostgame.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_sppostgame.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_spreset.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_spreset.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_spskill.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_spskill.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_startserver.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_startserver.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_syscalls.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_syscalls.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_team.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_team.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_teamorders.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_teamorders.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
5
code/q3_ui/.svn/prop-base/ui_video.c.svn-base
Executable file
5
code/q3_ui/.svn/prop-base/ui_video.c.svn-base
Executable file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 0
|
||||
|
||||
END
|
||||
92
code/q3_ui/.svn/text-base/Conscript.svn-base
Executable file
92
code/q3_ui/.svn/text-base/Conscript.svn-base
Executable file
@@ -0,0 +1,92 @@
|
||||
# Q3 ui building
|
||||
|
||||
# qvm building against native:
|
||||
# only native has ui_syscalls.c
|
||||
# qvm uses a ui_syscalls.asm with equ stubs
|
||||
# qvm has additional bg_lib.c
|
||||
|
||||
Import qw( BASE_CFLAGS TARGET_DIR INSTALL_DIR NO_VM NO_SO );
|
||||
|
||||
$env = new cons(
|
||||
# the code has the very bad habit of doing things like #include "../ui/ui_shared.h"
|
||||
# this seems to confuse the dependency analysis, explicit toplevel includes seem to fix
|
||||
CPPPATH => '#cgame:#game:#q3_ui',
|
||||
CC => 'gcc',
|
||||
CFLAGS => $BASE_CFLAGS . '-fPIC',
|
||||
LDFLAGS => '-shared -ldl -lm'
|
||||
);
|
||||
|
||||
# qvm building
|
||||
# we heavily customize the cons environment
|
||||
$vm_env = new cons(
|
||||
# the code has the very bad habit of doing things like #include "../ui/ui_shared.h"
|
||||
# this seems to confuse the dependency analysis, explicit toplevel includes seem to fix
|
||||
CPPPATH => '#cgame:#game:#q3_ui',
|
||||
CC => 'q3lcc',
|
||||
CCCOM => '%CC %CFLAGS %_IFLAGS -c %< -o %>',
|
||||
SUFOBJ => '.asm',
|
||||
LINK => 'q3asm',
|
||||
CFLAGS => '-DQ3_VM -S -Wf-target=bytecode -Wf-g',
|
||||
# need to know where to find the compiler tools
|
||||
ENV => { PATH => $ENV{PATH} . ":./qvmtools", },
|
||||
);
|
||||
|
||||
# the file with vmMain function MUST be the first one of the list
|
||||
@FILES = qw(
|
||||
ui_main.c
|
||||
../game/bg_misc.c
|
||||
../game/q_math.c
|
||||
../game/q_shared.c
|
||||
ui_addbots.c
|
||||
ui_atoms.c
|
||||
ui_cdkey.c
|
||||
ui_cinematics.c
|
||||
ui_confirm.c
|
||||
ui_connect.c
|
||||
ui_controls2.c
|
||||
ui_credits.c
|
||||
ui_demo2.c
|
||||
ui_display.c
|
||||
ui_gameinfo.c
|
||||
ui_ingame.c
|
||||
ui_loadconfig.c
|
||||
ui_menu.c
|
||||
ui_mfield.c
|
||||
ui_mods.c
|
||||
ui_network.c
|
||||
ui_options.c
|
||||
ui_playermodel.c
|
||||
ui_players.c
|
||||
ui_playersettings.c
|
||||
ui_preferences.c
|
||||
ui_qmenu.c
|
||||
ui_removebots.c
|
||||
ui_saveconfig.c
|
||||
ui_serverinfo.c
|
||||
ui_servers2.c
|
||||
ui_setup.c
|
||||
ui_sound.c
|
||||
ui_sparena.c
|
||||
ui_specifyserver.c
|
||||
ui_splevel.c
|
||||
ui_sppostgame.c
|
||||
ui_spskill.c
|
||||
ui_startserver.c
|
||||
ui_team.c
|
||||
ui_teamorders.c
|
||||
ui_video.c
|
||||
);
|
||||
$FILESREF = \@FILES;
|
||||
|
||||
if ($NO_SO eq 0)
|
||||
{
|
||||
Program $env 'uii386.so', @$FILESREF, 'ui_syscalls.c';
|
||||
Install $env $INSTALL_DIR, 'uii386.so';
|
||||
}
|
||||
if ($NO_VM eq 0)
|
||||
{
|
||||
Depends $vm_env 'ui.qvm', '#qvmtools/q3lcc';
|
||||
Depends $vm_env 'ui.qvm', '#qvmtools/q3asm';
|
||||
Program $vm_env 'ui.qvm', @$FILESREF, '../game/bg_lib.c', '../ui/ui_syscalls.asm';
|
||||
Install $vm_env $INSTALL_DIR . '/vm', 'ui.qvm';
|
||||
}
|
||||
2
code/q3_ui/.svn/text-base/compile.bat.svn-base
Executable file
2
code/q3_ui/.svn/text-base/compile.bat.svn-base
Executable file
@@ -0,0 +1,2 @@
|
||||
lcc -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\ui %1
|
||||
|
||||
143
code/q3_ui/.svn/text-base/keycodes.h.svn-base
Executable file
143
code/q3_ui/.svn/text-base/keycodes.h.svn-base
Executable file
@@ -0,0 +1,143 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
#ifndef __KEYCODES_H__
|
||||
#define __KEYCODES_H__
|
||||
|
||||
//
|
||||
// these are the key numbers that should be passed to KeyEvent
|
||||
//
|
||||
|
||||
// normal keys should be passed as lowercased ascii
|
||||
|
||||
typedef enum {
|
||||
K_TAB = 9,
|
||||
K_ENTER = 13,
|
||||
K_ESCAPE = 27,
|
||||
K_SPACE = 32,
|
||||
|
||||
K_BACKSPACE = 127,
|
||||
|
||||
K_COMMAND = 128,
|
||||
K_CAPSLOCK,
|
||||
K_POWER,
|
||||
K_PAUSE,
|
||||
|
||||
K_UPARROW,
|
||||
K_DOWNARROW,
|
||||
K_LEFTARROW,
|
||||
K_RIGHTARROW,
|
||||
|
||||
K_ALT,
|
||||
K_CTRL,
|
||||
K_SHIFT,
|
||||
K_INS,
|
||||
K_DEL,
|
||||
K_PGDN,
|
||||
K_PGUP,
|
||||
K_HOME,
|
||||
K_END,
|
||||
|
||||
K_F1,
|
||||
K_F2,
|
||||
K_F3,
|
||||
K_F4,
|
||||
K_F5,
|
||||
K_F6,
|
||||
K_F7,
|
||||
K_F8,
|
||||
K_F9,
|
||||
K_F10,
|
||||
K_F11,
|
||||
K_F12,
|
||||
K_F13,
|
||||
K_F14,
|
||||
K_F15,
|
||||
|
||||
K_KP_HOME,
|
||||
K_KP_UPARROW,
|
||||
K_KP_PGUP,
|
||||
K_KP_LEFTARROW,
|
||||
K_KP_5,
|
||||
K_KP_RIGHTARROW,
|
||||
K_KP_END,
|
||||
K_KP_DOWNARROW,
|
||||
K_KP_PGDN,
|
||||
K_KP_ENTER,
|
||||
K_KP_INS,
|
||||
K_KP_DEL,
|
||||
K_KP_SLASH,
|
||||
K_KP_MINUS,
|
||||
K_KP_PLUS,
|
||||
K_KP_NUMLOCK,
|
||||
K_KP_STAR,
|
||||
K_KP_EQUALS,
|
||||
|
||||
K_MOUSE1,
|
||||
K_MOUSE2,
|
||||
K_MOUSE3,
|
||||
K_MOUSE4,
|
||||
K_MOUSE5,
|
||||
|
||||
K_MWHEELDOWN,
|
||||
K_MWHEELUP,
|
||||
|
||||
K_JOY1,
|
||||
K_JOY2,
|
||||
K_JOY3,
|
||||
K_JOY4,
|
||||
K_JOY5,
|
||||
K_JOY6,
|
||||
K_JOY7,
|
||||
K_JOY8,
|
||||
K_JOY9,
|
||||
K_JOY10,
|
||||
K_JOY11,
|
||||
K_JOY12,
|
||||
K_JOY13,
|
||||
K_JOY14,
|
||||
K_JOY15,
|
||||
K_JOY16,
|
||||
K_JOY17,
|
||||
K_JOY18,
|
||||
K_JOY19,
|
||||
K_JOY20,
|
||||
K_JOY21,
|
||||
K_JOY22,
|
||||
K_JOY23,
|
||||
K_JOY24,
|
||||
K_JOY25,
|
||||
K_JOY26,
|
||||
K_JOY27,
|
||||
K_JOY28,
|
||||
K_JOY29,
|
||||
K_JOY30,
|
||||
K_JOY31,
|
||||
K_JOY32,
|
||||
|
||||
K_AUX1,
|
||||
K_AUX2,
|
||||
K_AUX3,
|
||||
K_AUX4,
|
||||
K_AUX5,
|
||||
K_AUX6,
|
||||
K_AUX7,
|
||||
K_AUX8,
|
||||
K_AUX9,
|
||||
K_AUX10,
|
||||
K_AUX11,
|
||||
K_AUX12,
|
||||
K_AUX13,
|
||||
K_AUX14,
|
||||
K_AUX15,
|
||||
K_AUX16,
|
||||
|
||||
K_LAST_KEY // this had better be <256!
|
||||
} keyNum_t;
|
||||
|
||||
|
||||
// The menu code needs to get both key and char events, but
|
||||
// to avoid duplicating the paths, the char events are just
|
||||
// distinguished by or'ing in K_CHAR_FLAG (ugly)
|
||||
#define K_CHAR_FLAG 1024
|
||||
|
||||
#endif
|
||||
100
code/q3_ui/.svn/text-base/q3_ui.bat.svn-base
Executable file
100
code/q3_ui/.svn/text-base/q3_ui.bat.svn-base
Executable file
@@ -0,0 +1,100 @@
|
||||
mkdir vm
|
||||
cd vm
|
||||
|
||||
set cc=lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui %1
|
||||
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_main.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_cdkey.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_ingame.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_serverinfo.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_confirm.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_setup.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../../game/bg_misc.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../../game/bg_lib.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../../game/q_math.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../../game/q_shared.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_gameinfo.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_atoms.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_connect.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_controls2.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_demo2.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_mfield.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_credits.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_menu.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_options.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_display.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_sound.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_network.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_playermodel.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_players.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_playersettings.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_preferences.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_qmenu.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_servers2.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_sparena.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_specifyleague.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_specifyserver.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_splevel.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_sppostgame.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_startserver.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_syscalls.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_team.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_video.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_cinematics.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_spskill.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_addbots.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_removebots.c
|
||||
@if errorlevel 1 goto quit
|
||||
rem lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_loadconfig.c
|
||||
rem @if errorlevel 1 goto quit
|
||||
rem lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_saveconfig.c
|
||||
rem @if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_teamorders.c
|
||||
@if errorlevel 1 goto quit
|
||||
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\q3_ui ../ui_mods.c
|
||||
@if errorlevel 1 goto quit
|
||||
|
||||
|
||||
q3asm -f ../q3_ui
|
||||
:quit
|
||||
cd ..
|
||||
1070
code/q3_ui/.svn/text-base/q3_ui.dsp.svn-base
Executable file
1070
code/q3_ui/.svn/text-base/q3_ui.dsp.svn-base
Executable file
File diff suppressed because it is too large
Load Diff
43
code/q3_ui/.svn/text-base/q3_ui.q3asm.svn-base
Executable file
43
code/q3_ui/.svn/text-base/q3_ui.q3asm.svn-base
Executable file
@@ -0,0 +1,43 @@
|
||||
-o "\quake3\baseq3\vm\q3_ui"
|
||||
ui_main
|
||||
..\ui_syscalls
|
||||
ui_gameinfo
|
||||
ui_atoms
|
||||
ui_cinematics
|
||||
ui_connect
|
||||
ui_controls2
|
||||
ui_demo2
|
||||
ui_mfield
|
||||
ui_credits
|
||||
ui_menu
|
||||
ui_ingame
|
||||
ui_confirm
|
||||
ui_setup
|
||||
ui_options
|
||||
ui_display
|
||||
ui_sound
|
||||
ui_network
|
||||
ui_playermodel
|
||||
ui_players
|
||||
ui_playersettings
|
||||
ui_preferences
|
||||
ui_qmenu
|
||||
ui_serverinfo
|
||||
ui_servers2
|
||||
ui_sparena
|
||||
ui_specifyserver
|
||||
ui_sppostgame
|
||||
ui_splevel
|
||||
ui_spskill
|
||||
ui_startserver
|
||||
ui_team
|
||||
ui_video
|
||||
ui_addbots
|
||||
ui_removebots
|
||||
ui_teamorders
|
||||
ui_cdkey
|
||||
ui_mods
|
||||
bg_misc
|
||||
bg_lib
|
||||
q_math
|
||||
q_shared
|
||||
55
code/q3_ui/.svn/text-base/q3_ui.sh.svn-base
Executable file
55
code/q3_ui/.svn/text-base/q3_ui.sh.svn-base
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/bin/sh
|
||||
|
||||
mkdir -p vm
|
||||
cd vm
|
||||
|
||||
CC="q3lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I../../cgame -I../../game -I../../q3_ui "
|
||||
|
||||
$CC ../ui_main.c
|
||||
$CC ../ui_cdkey.c
|
||||
$CC ../ui_ingame.c
|
||||
$CC ../ui_confirm.c
|
||||
$CC ../ui_setup.c
|
||||
$CC ../../game/bg_misc.c
|
||||
$CC ../../game/bg_lib.c
|
||||
$CC ../../game/q_math.c
|
||||
$CC ../../game/q_shared.c
|
||||
$CC ../ui_gameinfo.c
|
||||
$CC ../ui_atoms.c
|
||||
$CC ../ui_connect.c
|
||||
$CC ../ui_controls2.c
|
||||
$CC ../ui_demo2.c
|
||||
$CC ../ui_mfield.c
|
||||
$CC ../ui_credits.c
|
||||
$CC ../ui_menu.c
|
||||
$CC ../ui_options.c
|
||||
$CC ../ui_display.c
|
||||
$CC ../ui_sound.c
|
||||
$CC ../ui_network.c
|
||||
$CC ../ui_playermodel.c
|
||||
$CC ../ui_players.c
|
||||
$CC ../ui_playersettings.c
|
||||
$CC ../ui_preferences.c
|
||||
$CC ../ui_qmenu.c
|
||||
$CC ../ui_serverinfo.c
|
||||
$CC ../ui_servers2.c
|
||||
$CC ../ui_sparena.c
|
||||
$CC ../ui_specifyserver.c
|
||||
$CC ../ui_splevel.c
|
||||
$CC ../ui_sppostgame.c
|
||||
$CC ../ui_startserver.c
|
||||
$CC ../ui_syscalls.c
|
||||
$CC ../ui_team.c
|
||||
$CC ../ui_video.c
|
||||
$CC ../ui_cinematics.c
|
||||
$CC ../ui_spskill.c
|
||||
$CC ../ui_addbots.c
|
||||
$CC ../ui_removebots.c
|
||||
$CC ../ui_loadconfig.c
|
||||
$CC ../ui_saveconfig.c
|
||||
$CC ../ui_teamorders.c
|
||||
$CC ../ui_mods.c
|
||||
|
||||
q3asm -f ../q3_ui
|
||||
|
||||
cd ..
|
||||
973
code/q3_ui/.svn/text-base/q3_ui.vcproj.svn-base
Executable file
973
code/q3_ui/.svn/text-base/q3_ui.vcproj.svn-base
Executable file
@@ -0,0 +1,973 @@
|
||||
<?xml version="1.0"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.00"
|
||||
Name="q3_ui"
|
||||
SccProjectName=""$/MissionPack/code/q3_ui", VFLAAAAA"
|
||||
SccAuxPath="\\Purgatory\Purgatory\idSourceControl"
|
||||
SccLocalPath="."
|
||||
SccProvider="MSSCCI:SourceSafe">
|
||||
<Build>
|
||||
<Settings>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
IntermediateDirectory=".\Release"
|
||||
OutputDirectory=".\Release"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupMessage="TRUE"
|
||||
OutputFile=".\Release/q3_ui.bsc"/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
Defines="WIN32;NDEBUG;_WINDOWS;_USRDLL;Q3_UI_EXPORTS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
PackageFunctions="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Release/q3_ui.pch"
|
||||
AsmListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarnLevel="3"
|
||||
SuppressStartupMessage="TRUE"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalInputs="odbc32.lib odbccp32.lib"
|
||||
OutputFile="../Release/uix86.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupMessage="TRUE"
|
||||
ModuleDefinitionFile=".\ui.def"
|
||||
ProgramDatabaseFile=".\Release/uix86.pdb"
|
||||
ImportLibrary=".\Release/uix86.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
Defines="NDEBUG"
|
||||
MkTypLibCompatibility="TRUE"
|
||||
SuppressStartupMessage="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Release/q3_ui.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
Defines="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCSDLTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug TA|Win32"
|
||||
IntermediateDirectory=".\Debug_TA"
|
||||
OutputDirectory=".\Debug_TA"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupMessage="TRUE"
|
||||
OutputFile=".\Debug_TA/q3_ui.bsc"/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
OptimizeForProcessor="1"
|
||||
Defines="WIN32;_DEBUG;_WINDOWS;_USRDLL;UI_EXPORTS"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="Debug/q3_ui.pch"
|
||||
AsmListingLocation=".\Debug_TA/"
|
||||
ObjectFile="Debug/"
|
||||
ProgramDataBaseFileName="Debug/"
|
||||
BrowseInformation="1"
|
||||
WarnLevel="3"
|
||||
SuppressStartupMessage="TRUE"
|
||||
DebugInformation="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalInputs="odbc32.lib odbccp32.lib"
|
||||
OutputFile="../Debug_TA/uix86_old.dll"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupMessage="TRUE"
|
||||
ModuleDefinitionFile=".\ui.def"
|
||||
GenerateDebug="TRUE"
|
||||
ProgramDatabaseFile="../Debug_TA/ui.pdb"
|
||||
GenerateMapFile="TRUE"
|
||||
MapFileName="Debug_TA/uix86.map"
|
||||
BaseAddress="0x40000000"
|
||||
ImportLibrary="Debug_TA/uix86.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
Defines="_DEBUG"
|
||||
MkTypLibCompatibility="TRUE"
|
||||
SuppressStartupMessage="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Debug_TA/q3_ui.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
Defines="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCSDLTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
IntermediateDirectory=".\q3_ui___Win32_Debug"
|
||||
OutputDirectory=".\q3_ui___Win32_Debug"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupMessage="TRUE"
|
||||
OutputFile=".\q3_ui___Win32_Debug/q3_ui.bsc"/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
OptimizeForProcessor="1"
|
||||
Defines="WIN32;_DEBUG;_WINDOWS;_USRDLL;UI_EXPORTS"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile="Debug/q3_ui.pch"
|
||||
AsmListingLocation=".\q3_ui___Win32_Debug/"
|
||||
ObjectFile="Debug/"
|
||||
ProgramDataBaseFileName="Debug/"
|
||||
BrowseInformation="1"
|
||||
WarnLevel="3"
|
||||
SuppressStartupMessage="TRUE"
|
||||
DebugInformation="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalInputs="odbc32.lib odbccp32.lib"
|
||||
OutputFile="../Debug/uix86.dll"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupMessage="TRUE"
|
||||
ModuleDefinitionFile=".\ui.def"
|
||||
GenerateDebug="TRUE"
|
||||
ProgramDatabaseFile="../Debug/ui.pdb"
|
||||
GenerateMapFile="TRUE"
|
||||
MapFileName="Debug/uix86.map"
|
||||
BaseAddress="0x40000000"
|
||||
ImportLibrary="Debug/uix86.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
Defines="_DEBUG"
|
||||
MkTypLibCompatibility="TRUE"
|
||||
SuppressStartupMessage="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\q3_ui___Win32_Debug/q3_ui.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
Defines="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCSDLTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release TA|Win32"
|
||||
IntermediateDirectory=".\Release_TA"
|
||||
OutputDirectory=".\Release_TA"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupMessage="TRUE"
|
||||
OutputFile=".\Release_TA/q3_ui.bsc"/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
Defines="WIN32;NDEBUG;_WINDOWS;_USRDLL;Q3_UI_EXPORTS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
PackageFunctions="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Release_TA/q3_ui.pch"
|
||||
AsmListingLocation=".\Release_TA/"
|
||||
ObjectFile=".\Release_TA/"
|
||||
ProgramDataBaseFileName=".\Release_TA/"
|
||||
WarnLevel="3"
|
||||
SuppressStartupMessage="TRUE"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalInputs="odbc32.lib odbccp32.lib"
|
||||
OutputFile="../Release_TA/uix86_old.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupMessage="TRUE"
|
||||
ModuleDefinitionFile=".\ui.def"
|
||||
ProgramDatabaseFile=".\Release_TA/uix86_old.pdb"
|
||||
ImportLibrary="Release_TA/q3_ui.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
Defines="NDEBUG"
|
||||
MkTypLibCompatibility="TRUE"
|
||||
SuppressStartupMessage="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Release_TA/q3_ui.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
Defines="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCSDLTool"/>
|
||||
</Configuration>
|
||||
</Settings>
|
||||
</Build>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="..\game\bg_misc.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\game\q_math.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\game\q_shared.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui.def">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_addbots.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_atoms.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_cdkey.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_cinematics.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_confirm.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_connect.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_controls2.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_credits.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_demo2.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_display.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_gameinfo.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_ingame.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_loadconfig.c">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_main.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_menu.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_mfield.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_mods.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_network.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_options.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_playermodel.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_players.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_playersettings.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_preferences.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_qmenu.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_removebots.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_saveconfig.c">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_serverinfo.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_servers2.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_setup.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_sound.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_sparena.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_specifyserver.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_splevel.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_sppostgame.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_spreset.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_spskill.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_startserver.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_syscalls.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_team.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_teamorders.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_video.c">
|
||||
<FileConfiguration
|
||||
Name="Debug TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release TA|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath=".\keycodes.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\game\q_shared.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_local.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ui_public.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
3
code/q3_ui/.svn/text-base/ui.def.svn-base
Executable file
3
code/q3_ui/.svn/text-base/ui.def.svn-base
Executable file
@@ -0,0 +1,3 @@
|
||||
EXPORTS
|
||||
vmMain
|
||||
dllEntry
|
||||
45
code/q3_ui/.svn/text-base/ui.q3asm.svn-base
Executable file
45
code/q3_ui/.svn/text-base/ui.q3asm.svn-base
Executable file
@@ -0,0 +1,45 @@
|
||||
-o "\quake3\baseq3\vm\ui"
|
||||
ui_main
|
||||
..\ui_syscalls
|
||||
ui_gameinfo
|
||||
ui_atoms
|
||||
ui_cinematics
|
||||
ui_connect
|
||||
ui_controls2
|
||||
ui_demo2
|
||||
ui_mfield
|
||||
ui_credits
|
||||
ui_menu
|
||||
ui_ingame
|
||||
ui_confirm
|
||||
ui_setup
|
||||
ui_options
|
||||
ui_display
|
||||
ui_sound
|
||||
ui_network
|
||||
ui_playermodel
|
||||
ui_players
|
||||
ui_playersettings
|
||||
ui_preferences
|
||||
ui_qmenu
|
||||
ui_serverinfo
|
||||
ui_servers2
|
||||
ui_sparena
|
||||
ui_specifyserver
|
||||
ui_sppostgame
|
||||
ui_splevel
|
||||
ui_spskill
|
||||
ui_startserver
|
||||
ui_team
|
||||
ui_video
|
||||
ui_addbots
|
||||
ui_removebots
|
||||
ui_teamorders
|
||||
ui_loadconfig
|
||||
ui_saveconfig
|
||||
ui_cdkey
|
||||
ui_mods
|
||||
bg_misc
|
||||
bg_lib
|
||||
q_math
|
||||
q_shared
|
||||
392
code/q3_ui/.svn/text-base/ui_addbots.c.svn-base
Executable file
392
code/q3_ui/.svn/text-base/ui_addbots.c.svn-base
Executable file
@@ -0,0 +1,392 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
/*
|
||||
=======================================================================
|
||||
|
||||
ADD BOTS MENU
|
||||
|
||||
=======================================================================
|
||||
*/
|
||||
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define ART_BACK0 "menu/art/back_0"
|
||||
#define ART_BACK1 "menu/art/back_1"
|
||||
#define ART_FIGHT0 "menu/art/accept_0"
|
||||
#define ART_FIGHT1 "menu/art/accept_1"
|
||||
#define ART_BACKGROUND "menu/art/addbotframe"
|
||||
#define ART_ARROWS "menu/art/arrows_vert_0"
|
||||
#define ART_ARROWUP "menu/art/arrows_vert_top"
|
||||
#define ART_ARROWDOWN "menu/art/arrows_vert_bot"
|
||||
|
||||
#define ID_BACK 10
|
||||
#define ID_GO 11
|
||||
#define ID_LIST 12
|
||||
#define ID_UP 13
|
||||
#define ID_DOWN 14
|
||||
#define ID_SKILL 15
|
||||
#define ID_TEAM 16
|
||||
#define ID_BOTNAME0 20
|
||||
#define ID_BOTNAME1 21
|
||||
#define ID_BOTNAME2 22
|
||||
#define ID_BOTNAME3 23
|
||||
#define ID_BOTNAME4 24
|
||||
#define ID_BOTNAME5 25
|
||||
#define ID_BOTNAME6 26
|
||||
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
menubitmap_s arrows;
|
||||
menubitmap_s up;
|
||||
menubitmap_s down;
|
||||
menutext_s bots[7];
|
||||
menulist_s skill;
|
||||
menulist_s team;
|
||||
menubitmap_s go;
|
||||
menubitmap_s back;
|
||||
|
||||
int numBots;
|
||||
int delay;
|
||||
int baseBotNum;
|
||||
int selectedBotNum;
|
||||
int sortedBotNums[MAX_BOTS];
|
||||
char botnames[7][32];
|
||||
} addBotsMenuInfo_t;
|
||||
|
||||
static addBotsMenuInfo_t addBotsMenuInfo;
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_AddBotsMenu_FightEvent
|
||||
=================
|
||||
*/
|
||||
static void UI_AddBotsMenu_FightEvent( void* ptr, int event ) {
|
||||
const char *team;
|
||||
int skill;
|
||||
|
||||
if (event != QM_ACTIVATED) {
|
||||
return;
|
||||
}
|
||||
|
||||
team = addBotsMenuInfo.team.itemnames[addBotsMenuInfo.team.curvalue];
|
||||
skill = addBotsMenuInfo.skill.curvalue + 1;
|
||||
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va("addbot %s %i %s %i\n",
|
||||
addBotsMenuInfo.botnames[addBotsMenuInfo.selectedBotNum], skill, team, addBotsMenuInfo.delay) );
|
||||
|
||||
addBotsMenuInfo.delay += 1500;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_AddBotsMenu_BotEvent
|
||||
=================
|
||||
*/
|
||||
static void UI_AddBotsMenu_BotEvent( void* ptr, int event ) {
|
||||
if (event != QM_ACTIVATED) {
|
||||
return;
|
||||
}
|
||||
|
||||
addBotsMenuInfo.bots[addBotsMenuInfo.selectedBotNum].color = color_orange;
|
||||
addBotsMenuInfo.selectedBotNum = ((menucommon_s*)ptr)->id - ID_BOTNAME0;
|
||||
addBotsMenuInfo.bots[addBotsMenuInfo.selectedBotNum].color = color_white;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_AddBotsMenu_BackEvent
|
||||
=================
|
||||
*/
|
||||
static void UI_AddBotsMenu_BackEvent( void* ptr, int event ) {
|
||||
if (event != QM_ACTIVATED) {
|
||||
return;
|
||||
}
|
||||
UI_PopMenu();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_AddBotsMenu_SetBotNames
|
||||
=================
|
||||
*/
|
||||
static void UI_AddBotsMenu_SetBotNames( void ) {
|
||||
int n;
|
||||
const char *info;
|
||||
|
||||
for ( n = 0; n < 7; n++ ) {
|
||||
info = UI_GetBotInfoByNumber( addBotsMenuInfo.sortedBotNums[addBotsMenuInfo.baseBotNum + n] );
|
||||
Q_strncpyz( addBotsMenuInfo.botnames[n], Info_ValueForKey( info, "name" ), sizeof(addBotsMenuInfo.botnames[n]) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_AddBotsMenu_UpEvent
|
||||
=================
|
||||
*/
|
||||
static void UI_AddBotsMenu_UpEvent( void* ptr, int event ) {
|
||||
if (event != QM_ACTIVATED) {
|
||||
return;
|
||||
}
|
||||
|
||||
if( addBotsMenuInfo.baseBotNum > 0 ) {
|
||||
addBotsMenuInfo.baseBotNum--;
|
||||
UI_AddBotsMenu_SetBotNames();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_AddBotsMenu_DownEvent
|
||||
=================
|
||||
*/
|
||||
static void UI_AddBotsMenu_DownEvent( void* ptr, int event ) {
|
||||
if (event != QM_ACTIVATED) {
|
||||
return;
|
||||
}
|
||||
|
||||
if( addBotsMenuInfo.baseBotNum + 7 < addBotsMenuInfo.numBots ) {
|
||||
addBotsMenuInfo.baseBotNum++;
|
||||
UI_AddBotsMenu_SetBotNames();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_AddBotsMenu_GetSortedBotNums
|
||||
=================
|
||||
*/
|
||||
static int QDECL UI_AddBotsMenu_SortCompare( const void *arg1, const void *arg2 ) {
|
||||
int num1, num2;
|
||||
const char *info1, *info2;
|
||||
const char *name1, *name2;
|
||||
|
||||
num1 = *(int *)arg1;
|
||||
num2 = *(int *)arg2;
|
||||
|
||||
info1 = UI_GetBotInfoByNumber( num1 );
|
||||
info2 = UI_GetBotInfoByNumber( num2 );
|
||||
|
||||
name1 = Info_ValueForKey( info1, "name" );
|
||||
name2 = Info_ValueForKey( info2, "name" );
|
||||
|
||||
return Q_stricmp( name1, name2 );
|
||||
}
|
||||
|
||||
static void UI_AddBotsMenu_GetSortedBotNums( void ) {
|
||||
int n;
|
||||
|
||||
// initialize the array
|
||||
for( n = 0; n < addBotsMenuInfo.numBots; n++ ) {
|
||||
addBotsMenuInfo.sortedBotNums[n] = n;
|
||||
}
|
||||
|
||||
qsort( addBotsMenuInfo.sortedBotNums, addBotsMenuInfo.numBots, sizeof(addBotsMenuInfo.sortedBotNums[0]), UI_AddBotsMenu_SortCompare );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_AddBotsMenu_Draw
|
||||
=================
|
||||
*/
|
||||
static void UI_AddBotsMenu_Draw( void ) {
|
||||
UI_DrawBannerString( 320, 16, "ADD BOTS", UI_CENTER, color_white );
|
||||
UI_DrawNamedPic( 320-233, 240-166, 466, 332, ART_BACKGROUND );
|
||||
|
||||
// standard menu drawing
|
||||
Menu_Draw( &addBotsMenuInfo.menu );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_AddBotsMenu_Init
|
||||
=================
|
||||
*/
|
||||
static const char *skillNames[] = {
|
||||
"I Can Win",
|
||||
"Bring It On",
|
||||
"Hurt Me Plenty",
|
||||
"Hardcore",
|
||||
"Nightmare!",
|
||||
0
|
||||
};
|
||||
|
||||
static const char *teamNames1[] = {
|
||||
"Free",
|
||||
0
|
||||
};
|
||||
|
||||
static const char *teamNames2[] = {
|
||||
"Red",
|
||||
"Blue",
|
||||
0
|
||||
};
|
||||
|
||||
static void UI_AddBotsMenu_Init( void ) {
|
||||
int n;
|
||||
int y;
|
||||
int gametype;
|
||||
int count;
|
||||
char info[MAX_INFO_STRING];
|
||||
|
||||
trap_GetConfigString(CS_SERVERINFO, info, MAX_INFO_STRING);
|
||||
gametype = atoi( Info_ValueForKey( info,"g_gametype" ) );
|
||||
|
||||
memset( &addBotsMenuInfo, 0 ,sizeof(addBotsMenuInfo) );
|
||||
addBotsMenuInfo.menu.draw = UI_AddBotsMenu_Draw;
|
||||
addBotsMenuInfo.menu.fullscreen = qfalse;
|
||||
addBotsMenuInfo.menu.wrapAround = qtrue;
|
||||
addBotsMenuInfo.delay = 1000;
|
||||
|
||||
UI_AddBots_Cache();
|
||||
|
||||
addBotsMenuInfo.numBots = UI_GetNumBots();
|
||||
count = addBotsMenuInfo.numBots < 7 ? addBotsMenuInfo.numBots : 7;
|
||||
|
||||
addBotsMenuInfo.arrows.generic.type = MTYPE_BITMAP;
|
||||
addBotsMenuInfo.arrows.generic.name = ART_ARROWS;
|
||||
addBotsMenuInfo.arrows.generic.flags = QMF_INACTIVE;
|
||||
addBotsMenuInfo.arrows.generic.x = 200;
|
||||
addBotsMenuInfo.arrows.generic.y = 128;
|
||||
addBotsMenuInfo.arrows.width = 64;
|
||||
addBotsMenuInfo.arrows.height = 128;
|
||||
|
||||
addBotsMenuInfo.up.generic.type = MTYPE_BITMAP;
|
||||
addBotsMenuInfo.up.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
addBotsMenuInfo.up.generic.x = 200;
|
||||
addBotsMenuInfo.up.generic.y = 128;
|
||||
addBotsMenuInfo.up.generic.id = ID_UP;
|
||||
addBotsMenuInfo.up.generic.callback = UI_AddBotsMenu_UpEvent;
|
||||
addBotsMenuInfo.up.width = 64;
|
||||
addBotsMenuInfo.up.height = 64;
|
||||
addBotsMenuInfo.up.focuspic = ART_ARROWUP;
|
||||
|
||||
addBotsMenuInfo.down.generic.type = MTYPE_BITMAP;
|
||||
addBotsMenuInfo.down.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
addBotsMenuInfo.down.generic.x = 200;
|
||||
addBotsMenuInfo.down.generic.y = 128+64;
|
||||
addBotsMenuInfo.down.generic.id = ID_DOWN;
|
||||
addBotsMenuInfo.down.generic.callback = UI_AddBotsMenu_DownEvent;
|
||||
addBotsMenuInfo.down.width = 64;
|
||||
addBotsMenuInfo.down.height = 64;
|
||||
addBotsMenuInfo.down.focuspic = ART_ARROWDOWN;
|
||||
|
||||
for( n = 0, y = 120; n < count; n++, y += 20 ) {
|
||||
addBotsMenuInfo.bots[n].generic.type = MTYPE_PTEXT;
|
||||
addBotsMenuInfo.bots[n].generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
addBotsMenuInfo.bots[n].generic.id = ID_BOTNAME0 + n;
|
||||
addBotsMenuInfo.bots[n].generic.x = 320 - 56;
|
||||
addBotsMenuInfo.bots[n].generic.y = y;
|
||||
addBotsMenuInfo.bots[n].generic.callback = UI_AddBotsMenu_BotEvent;
|
||||
addBotsMenuInfo.bots[n].string = addBotsMenuInfo.botnames[n];
|
||||
addBotsMenuInfo.bots[n].color = color_orange;
|
||||
addBotsMenuInfo.bots[n].style = UI_LEFT|UI_SMALLFONT;
|
||||
}
|
||||
|
||||
y += 12;
|
||||
addBotsMenuInfo.skill.generic.type = MTYPE_SPINCONTROL;
|
||||
addBotsMenuInfo.skill.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
addBotsMenuInfo.skill.generic.x = 320;
|
||||
addBotsMenuInfo.skill.generic.y = y;
|
||||
addBotsMenuInfo.skill.generic.name = "Skill:";
|
||||
addBotsMenuInfo.skill.generic.id = ID_SKILL;
|
||||
addBotsMenuInfo.skill.itemnames = skillNames;
|
||||
addBotsMenuInfo.skill.curvalue = Com_Clamp( 0, 4, (int)trap_Cvar_VariableValue( "g_spSkill" ) - 1 );
|
||||
|
||||
y += SMALLCHAR_HEIGHT;
|
||||
addBotsMenuInfo.team.generic.type = MTYPE_SPINCONTROL;
|
||||
addBotsMenuInfo.team.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
addBotsMenuInfo.team.generic.x = 320;
|
||||
addBotsMenuInfo.team.generic.y = y;
|
||||
addBotsMenuInfo.team.generic.name = "Team: ";
|
||||
addBotsMenuInfo.team.generic.id = ID_TEAM;
|
||||
if( gametype >= GT_TEAM ) {
|
||||
addBotsMenuInfo.team.itemnames = teamNames2;
|
||||
}
|
||||
else {
|
||||
addBotsMenuInfo.team.itemnames = teamNames1;
|
||||
addBotsMenuInfo.team.generic.flags = QMF_GRAYED;
|
||||
}
|
||||
|
||||
addBotsMenuInfo.go.generic.type = MTYPE_BITMAP;
|
||||
addBotsMenuInfo.go.generic.name = ART_FIGHT0;
|
||||
addBotsMenuInfo.go.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
addBotsMenuInfo.go.generic.id = ID_GO;
|
||||
addBotsMenuInfo.go.generic.callback = UI_AddBotsMenu_FightEvent;
|
||||
addBotsMenuInfo.go.generic.x = 320+128-128;
|
||||
addBotsMenuInfo.go.generic.y = 256+128-64;
|
||||
addBotsMenuInfo.go.width = 128;
|
||||
addBotsMenuInfo.go.height = 64;
|
||||
addBotsMenuInfo.go.focuspic = ART_FIGHT1;
|
||||
|
||||
addBotsMenuInfo.back.generic.type = MTYPE_BITMAP;
|
||||
addBotsMenuInfo.back.generic.name = ART_BACK0;
|
||||
addBotsMenuInfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
addBotsMenuInfo.back.generic.id = ID_BACK;
|
||||
addBotsMenuInfo.back.generic.callback = UI_AddBotsMenu_BackEvent;
|
||||
addBotsMenuInfo.back.generic.x = 320-128;
|
||||
addBotsMenuInfo.back.generic.y = 256+128-64;
|
||||
addBotsMenuInfo.back.width = 128;
|
||||
addBotsMenuInfo.back.height = 64;
|
||||
addBotsMenuInfo.back.focuspic = ART_BACK1;
|
||||
|
||||
addBotsMenuInfo.baseBotNum = 0;
|
||||
addBotsMenuInfo.selectedBotNum = 0;
|
||||
addBotsMenuInfo.bots[0].color = color_white;
|
||||
|
||||
UI_AddBotsMenu_GetSortedBotNums();
|
||||
UI_AddBotsMenu_SetBotNames();
|
||||
|
||||
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.arrows );
|
||||
|
||||
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.up );
|
||||
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.down );
|
||||
for( n = 0; n < count; n++ ) {
|
||||
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.bots[n] );
|
||||
}
|
||||
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.skill );
|
||||
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.team );
|
||||
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.go );
|
||||
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.back );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_AddBots_Cache
|
||||
=================
|
||||
*/
|
||||
void UI_AddBots_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( ART_BACK0 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK1 );
|
||||
trap_R_RegisterShaderNoMip( ART_FIGHT0 );
|
||||
trap_R_RegisterShaderNoMip( ART_FIGHT1 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACKGROUND );
|
||||
trap_R_RegisterShaderNoMip( ART_ARROWS );
|
||||
trap_R_RegisterShaderNoMip( ART_ARROWUP );
|
||||
trap_R_RegisterShaderNoMip( ART_ARROWDOWN );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_AddBotsMenu
|
||||
=================
|
||||
*/
|
||||
void UI_AddBotsMenu( void ) {
|
||||
UI_AddBotsMenu_Init();
|
||||
UI_PushMenu( &addBotsMenuInfo.menu );
|
||||
}
|
||||
1247
code/q3_ui/.svn/text-base/ui_atoms.c.svn-base
Executable file
1247
code/q3_ui/.svn/text-base/ui_atoms.c.svn-base
Executable file
File diff suppressed because it is too large
Load Diff
271
code/q3_ui/.svn/text-base/ui_cdkey.c.svn-base
Executable file
271
code/q3_ui/.svn/text-base/ui_cdkey.c.svn-base
Executable file
@@ -0,0 +1,271 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
/*
|
||||
=======================================================================
|
||||
|
||||
CD KEY MENU
|
||||
|
||||
=======================================================================
|
||||
*/
|
||||
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define ART_FRAME "menu/art/cut_frame"
|
||||
#define ART_ACCEPT0 "menu/art/accept_0"
|
||||
#define ART_ACCEPT1 "menu/art/accept_1"
|
||||
#define ART_BACK0 "menu/art/back_0"
|
||||
#define ART_BACK1 "menu/art/back_1"
|
||||
|
||||
#define ID_CDKEY 10
|
||||
#define ID_ACCEPT 11
|
||||
#define ID_BACK 12
|
||||
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
|
||||
menutext_s banner;
|
||||
menubitmap_s frame;
|
||||
|
||||
menufield_s cdkey;
|
||||
|
||||
menubitmap_s accept;
|
||||
menubitmap_s back;
|
||||
} cdkeyMenuInfo_t;
|
||||
|
||||
static cdkeyMenuInfo_t cdkeyMenuInfo;
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_CDKeyMenu_Event
|
||||
===============
|
||||
*/
|
||||
static void UI_CDKeyMenu_Event( void *ptr, int event ) {
|
||||
if( event != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch( ((menucommon_s*)ptr)->id ) {
|
||||
case ID_ACCEPT:
|
||||
if( cdkeyMenuInfo.cdkey.field.buffer[0] ) {
|
||||
trap_SetCDKey( cdkeyMenuInfo.cdkey.field.buffer );
|
||||
}
|
||||
UI_PopMenu();
|
||||
break;
|
||||
|
||||
case ID_BACK:
|
||||
UI_PopMenu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_CDKeyMenu_PreValidateKey
|
||||
=================
|
||||
*/
|
||||
static int UI_CDKeyMenu_PreValidateKey( const char *key ) {
|
||||
char ch;
|
||||
|
||||
if( strlen( key ) != 16 ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
while( ( ch = *key++ ) ) {
|
||||
switch( ch ) {
|
||||
case '2':
|
||||
case '3':
|
||||
case '7':
|
||||
case 'a':
|
||||
case 'b':
|
||||
case 'c':
|
||||
case 'd':
|
||||
case 'g':
|
||||
case 'h':
|
||||
case 'j':
|
||||
case 'l':
|
||||
case 'p':
|
||||
case 'r':
|
||||
case 's':
|
||||
case 't':
|
||||
case 'w':
|
||||
continue;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_CDKeyMenu_DrawKey
|
||||
=================
|
||||
*/
|
||||
static void UI_CDKeyMenu_DrawKey( void *self ) {
|
||||
menufield_s *f;
|
||||
qboolean focus;
|
||||
int style;
|
||||
char c;
|
||||
float *color;
|
||||
int x, y;
|
||||
int val;
|
||||
|
||||
f = (menufield_s *)self;
|
||||
|
||||
focus = (f->generic.parent->cursor == f->generic.menuPosition);
|
||||
|
||||
style = UI_LEFT;
|
||||
if( focus ) {
|
||||
color = color_yellow;
|
||||
}
|
||||
else {
|
||||
color = color_orange;
|
||||
}
|
||||
|
||||
x = 320 - 8 * BIGCHAR_WIDTH;
|
||||
y = 240 - BIGCHAR_HEIGHT / 2;
|
||||
UI_FillRect( x, y, 16 * BIGCHAR_WIDTH, BIGCHAR_HEIGHT, listbar_color );
|
||||
UI_DrawString( x, y, f->field.buffer, style, color );
|
||||
|
||||
// draw cursor if we have focus
|
||||
if( focus ) {
|
||||
if ( trap_Key_GetOverstrikeMode() ) {
|
||||
c = 11;
|
||||
} else {
|
||||
c = 10;
|
||||
}
|
||||
|
||||
style &= ~UI_PULSE;
|
||||
style |= UI_BLINK;
|
||||
|
||||
UI_DrawChar( x + f->field.cursor * BIGCHAR_WIDTH, y, c, style, color_white );
|
||||
}
|
||||
|
||||
val = UI_CDKeyMenu_PreValidateKey( f->field.buffer );
|
||||
if( val == 1 ) {
|
||||
UI_DrawProportionalString( 320, 376, "Please enter your CD Key", UI_CENTER|UI_SMALLFONT, color_yellow );
|
||||
}
|
||||
else if ( val == 0 ) {
|
||||
UI_DrawProportionalString( 320, 376, "The CD Key appears to be valid, thank you", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
}
|
||||
else {
|
||||
UI_DrawProportionalString( 320, 376, "The CD Key is not valid", UI_CENTER|UI_SMALLFONT, color_red );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_CDKeyMenu_Init
|
||||
===============
|
||||
*/
|
||||
static void UI_CDKeyMenu_Init( void ) {
|
||||
trap_Cvar_Set( "ui_cdkeychecked", "1" );
|
||||
|
||||
UI_CDKeyMenu_Cache();
|
||||
|
||||
memset( &cdkeyMenuInfo, 0, sizeof(cdkeyMenuInfo) );
|
||||
cdkeyMenuInfo.menu.wrapAround = qtrue;
|
||||
cdkeyMenuInfo.menu.fullscreen = qtrue;
|
||||
|
||||
cdkeyMenuInfo.banner.generic.type = MTYPE_BTEXT;
|
||||
cdkeyMenuInfo.banner.generic.x = 320;
|
||||
cdkeyMenuInfo.banner.generic.y = 16;
|
||||
cdkeyMenuInfo.banner.string = "CD KEY";
|
||||
cdkeyMenuInfo.banner.color = color_white;
|
||||
cdkeyMenuInfo.banner.style = UI_CENTER;
|
||||
|
||||
cdkeyMenuInfo.frame.generic.type = MTYPE_BITMAP;
|
||||
cdkeyMenuInfo.frame.generic.name = ART_FRAME;
|
||||
cdkeyMenuInfo.frame.generic.flags = QMF_INACTIVE;
|
||||
cdkeyMenuInfo.frame.generic.x = 142;
|
||||
cdkeyMenuInfo.frame.generic.y = 118;
|
||||
cdkeyMenuInfo.frame.width = 359;
|
||||
cdkeyMenuInfo.frame.height = 256;
|
||||
|
||||
cdkeyMenuInfo.cdkey.generic.type = MTYPE_FIELD;
|
||||
cdkeyMenuInfo.cdkey.generic.name = "CD Key:";
|
||||
cdkeyMenuInfo.cdkey.generic.flags = QMF_LOWERCASE;
|
||||
cdkeyMenuInfo.cdkey.generic.x = 320 - BIGCHAR_WIDTH * 2.5;
|
||||
cdkeyMenuInfo.cdkey.generic.y = 240 - BIGCHAR_HEIGHT / 2;
|
||||
cdkeyMenuInfo.cdkey.field.widthInChars = 16;
|
||||
cdkeyMenuInfo.cdkey.field.maxchars = 16;
|
||||
cdkeyMenuInfo.cdkey.generic.ownerdraw = UI_CDKeyMenu_DrawKey;
|
||||
|
||||
cdkeyMenuInfo.accept.generic.type = MTYPE_BITMAP;
|
||||
cdkeyMenuInfo.accept.generic.name = ART_ACCEPT0;
|
||||
cdkeyMenuInfo.accept.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
cdkeyMenuInfo.accept.generic.id = ID_ACCEPT;
|
||||
cdkeyMenuInfo.accept.generic.callback = UI_CDKeyMenu_Event;
|
||||
cdkeyMenuInfo.accept.generic.x = 640;
|
||||
cdkeyMenuInfo.accept.generic.y = 480-64;
|
||||
cdkeyMenuInfo.accept.width = 128;
|
||||
cdkeyMenuInfo.accept.height = 64;
|
||||
cdkeyMenuInfo.accept.focuspic = ART_ACCEPT1;
|
||||
|
||||
cdkeyMenuInfo.back.generic.type = MTYPE_BITMAP;
|
||||
cdkeyMenuInfo.back.generic.name = ART_BACK0;
|
||||
cdkeyMenuInfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
cdkeyMenuInfo.back.generic.id = ID_BACK;
|
||||
cdkeyMenuInfo.back.generic.callback = UI_CDKeyMenu_Event;
|
||||
cdkeyMenuInfo.back.generic.x = 0;
|
||||
cdkeyMenuInfo.back.generic.y = 480-64;
|
||||
cdkeyMenuInfo.back.width = 128;
|
||||
cdkeyMenuInfo.back.height = 64;
|
||||
cdkeyMenuInfo.back.focuspic = ART_BACK1;
|
||||
|
||||
Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.banner );
|
||||
Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.frame );
|
||||
Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.cdkey );
|
||||
Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.accept );
|
||||
if( uis.menusp ) {
|
||||
Menu_AddItem( &cdkeyMenuInfo.menu, &cdkeyMenuInfo.back );
|
||||
}
|
||||
|
||||
trap_GetCDKey( cdkeyMenuInfo.cdkey.field.buffer, cdkeyMenuInfo.cdkey.field.maxchars + 1 );
|
||||
if( trap_VerifyCDKey( cdkeyMenuInfo.cdkey.field.buffer, NULL ) == qfalse ) {
|
||||
cdkeyMenuInfo.cdkey.field.buffer[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_CDKeyMenu_Cache
|
||||
=================
|
||||
*/
|
||||
void UI_CDKeyMenu_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( ART_ACCEPT0 );
|
||||
trap_R_RegisterShaderNoMip( ART_ACCEPT1 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK0 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK1 );
|
||||
trap_R_RegisterShaderNoMip( ART_FRAME );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_CDKeyMenu
|
||||
===============
|
||||
*/
|
||||
void UI_CDKeyMenu( void ) {
|
||||
UI_CDKeyMenu_Init();
|
||||
UI_PushMenu( &cdkeyMenuInfo.menu );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_CDKeyMenu_f
|
||||
===============
|
||||
*/
|
||||
void UI_CDKeyMenu_f( void ) {
|
||||
UI_CDKeyMenu();
|
||||
}
|
||||
330
code/q3_ui/.svn/text-base/ui_cinematics.c.svn-base
Executable file
330
code/q3_ui/.svn/text-base/ui_cinematics.c.svn-base
Executable file
@@ -0,0 +1,330 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define ART_BACK0 "menu/art/back_0"
|
||||
#define ART_BACK1 "menu/art/back_1"
|
||||
#define ART_FRAMEL "menu/art/frame2_l"
|
||||
#define ART_FRAMER "menu/art/frame1_r"
|
||||
|
||||
#define VERTICAL_SPACING 30
|
||||
|
||||
#define ID_BACK 10
|
||||
#define ID_CIN_IDLOGO 11
|
||||
#define ID_CIN_INTRO 12
|
||||
#define ID_CIN_TIER1 13
|
||||
#define ID_CIN_TIER2 14
|
||||
#define ID_CIN_TIER3 15
|
||||
#define ID_CIN_TIER4 16
|
||||
#define ID_CIN_TIER5 17
|
||||
#define ID_CIN_TIER6 18
|
||||
#define ID_CIN_TIER7 19
|
||||
#define ID_CIN_END 20
|
||||
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
menutext_s banner;
|
||||
menubitmap_s framel;
|
||||
menubitmap_s framer;
|
||||
menutext_s cin_idlogo;
|
||||
menutext_s cin_intro;
|
||||
menutext_s cin_tier1;
|
||||
menutext_s cin_tier2;
|
||||
menutext_s cin_tier3;
|
||||
menutext_s cin_tier4;
|
||||
menutext_s cin_tier5;
|
||||
menutext_s cin_tier6;
|
||||
menutext_s cin_tier7;
|
||||
menutext_s cin_end;
|
||||
menubitmap_s back;
|
||||
} cinematicsMenuInfo_t;
|
||||
|
||||
static cinematicsMenuInfo_t cinematicsMenuInfo;
|
||||
|
||||
static char *cinematics[] = {
|
||||
"idlogo",
|
||||
"intro",
|
||||
"tier1",
|
||||
"tier2",
|
||||
"tier3",
|
||||
"tier4",
|
||||
"tier5",
|
||||
"tier6",
|
||||
"tier7",
|
||||
"end"
|
||||
};
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_CinematicsMenu_BackEvent
|
||||
===============
|
||||
*/
|
||||
static void UI_CinematicsMenu_BackEvent( void *ptr, int event ) {
|
||||
if( event != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
UI_PopMenu();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_CinematicsMenu_Event
|
||||
===============
|
||||
*/
|
||||
static void UI_CinematicsMenu_Event( void *ptr, int event ) {
|
||||
int n;
|
||||
|
||||
if (event != QM_ACTIVATED)
|
||||
return;
|
||||
|
||||
n = ((menucommon_s*)ptr)->id - ID_CIN_IDLOGO;
|
||||
trap_Cvar_Set( "nextmap", va( "ui_cinematics %i", n ) );
|
||||
if( uis.demoversion && ((menucommon_s*)ptr)->id == ID_CIN_END ) {
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, "disconnect; cinematic demoEnd.RoQ 1\n" );
|
||||
}
|
||||
else {
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va( "disconnect; cinematic %s.RoQ\n", cinematics[n] ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_CinematicsMenu_Init
|
||||
===============
|
||||
*/
|
||||
static void UI_CinematicsMenu_Init( void ) {
|
||||
int y;
|
||||
|
||||
UI_CinematicsMenu_Cache();
|
||||
|
||||
memset( &cinematicsMenuInfo, 0, sizeof(cinematicsMenuInfo) );
|
||||
cinematicsMenuInfo.menu.fullscreen = qtrue;
|
||||
|
||||
cinematicsMenuInfo.banner.generic.type = MTYPE_BTEXT;
|
||||
cinematicsMenuInfo.banner.generic.x = 320;
|
||||
cinematicsMenuInfo.banner.generic.y = 16;
|
||||
cinematicsMenuInfo.banner.string = "CINEMATICS";
|
||||
cinematicsMenuInfo.banner.color = color_white;
|
||||
cinematicsMenuInfo.banner.style = UI_CENTER;
|
||||
|
||||
cinematicsMenuInfo.framel.generic.type = MTYPE_BITMAP;
|
||||
cinematicsMenuInfo.framel.generic.name = ART_FRAMEL;
|
||||
cinematicsMenuInfo.framel.generic.flags = QMF_INACTIVE;
|
||||
cinematicsMenuInfo.framel.generic.x = 0;
|
||||
cinematicsMenuInfo.framel.generic.y = 78;
|
||||
cinematicsMenuInfo.framel.width = 256;
|
||||
cinematicsMenuInfo.framel.height = 329;
|
||||
|
||||
cinematicsMenuInfo.framer.generic.type = MTYPE_BITMAP;
|
||||
cinematicsMenuInfo.framer.generic.name = ART_FRAMER;
|
||||
cinematicsMenuInfo.framer.generic.flags = QMF_INACTIVE;
|
||||
cinematicsMenuInfo.framer.generic.x = 376;
|
||||
cinematicsMenuInfo.framer.generic.y = 76;
|
||||
cinematicsMenuInfo.framer.width = 256;
|
||||
cinematicsMenuInfo.framer.height = 334;
|
||||
|
||||
y = 100;
|
||||
cinematicsMenuInfo.cin_idlogo.generic.type = MTYPE_PTEXT;
|
||||
cinematicsMenuInfo.cin_idlogo.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
cinematicsMenuInfo.cin_idlogo.generic.x = 320;
|
||||
cinematicsMenuInfo.cin_idlogo.generic.y = y;
|
||||
cinematicsMenuInfo.cin_idlogo.generic.id = ID_CIN_IDLOGO;
|
||||
cinematicsMenuInfo.cin_idlogo.generic.callback = UI_CinematicsMenu_Event;
|
||||
cinematicsMenuInfo.cin_idlogo.string = "ID LOGO";
|
||||
cinematicsMenuInfo.cin_idlogo.color = color_red;
|
||||
cinematicsMenuInfo.cin_idlogo.style = UI_CENTER;
|
||||
|
||||
y += VERTICAL_SPACING;
|
||||
cinematicsMenuInfo.cin_intro.generic.type = MTYPE_PTEXT;
|
||||
cinematicsMenuInfo.cin_intro.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
cinematicsMenuInfo.cin_intro.generic.x = 320;
|
||||
cinematicsMenuInfo.cin_intro.generic.y = y;
|
||||
cinematicsMenuInfo.cin_intro.generic.id = ID_CIN_INTRO;
|
||||
cinematicsMenuInfo.cin_intro.generic.callback = UI_CinematicsMenu_Event;
|
||||
cinematicsMenuInfo.cin_intro.string = "INTRO";
|
||||
cinematicsMenuInfo.cin_intro.color = color_red;
|
||||
cinematicsMenuInfo.cin_intro.style = UI_CENTER;
|
||||
if( uis.demoversion ) {
|
||||
cinematicsMenuInfo.cin_intro.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
|
||||
y += VERTICAL_SPACING;
|
||||
cinematicsMenuInfo.cin_tier1.generic.type = MTYPE_PTEXT;
|
||||
cinematicsMenuInfo.cin_tier1.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
cinematicsMenuInfo.cin_tier1.generic.x = 320;
|
||||
cinematicsMenuInfo.cin_tier1.generic.y = y;
|
||||
cinematicsMenuInfo.cin_tier1.generic.id = ID_CIN_TIER1;
|
||||
cinematicsMenuInfo.cin_tier1.generic.callback = UI_CinematicsMenu_Event;
|
||||
cinematicsMenuInfo.cin_tier1.string = "Tier 1";
|
||||
cinematicsMenuInfo.cin_tier1.color = color_red;
|
||||
cinematicsMenuInfo.cin_tier1.style = UI_CENTER;
|
||||
if( !UI_CanShowTierVideo( 1 ) ) {
|
||||
cinematicsMenuInfo.cin_tier1.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
|
||||
y += VERTICAL_SPACING;
|
||||
cinematicsMenuInfo.cin_tier2.generic.type = MTYPE_PTEXT;
|
||||
cinematicsMenuInfo.cin_tier2.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
cinematicsMenuInfo.cin_tier2.generic.x = 320;
|
||||
cinematicsMenuInfo.cin_tier2.generic.y = y;
|
||||
cinematicsMenuInfo.cin_tier2.generic.id = ID_CIN_TIER2;
|
||||
cinematicsMenuInfo.cin_tier2.generic.callback = UI_CinematicsMenu_Event;
|
||||
cinematicsMenuInfo.cin_tier2.string = "Tier 2";
|
||||
cinematicsMenuInfo.cin_tier2.color = color_red;
|
||||
cinematicsMenuInfo.cin_tier2.style = UI_CENTER;
|
||||
if( !UI_CanShowTierVideo( 2 ) ) {
|
||||
cinematicsMenuInfo.cin_tier2.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
|
||||
y += VERTICAL_SPACING;
|
||||
cinematicsMenuInfo.cin_tier3.generic.type = MTYPE_PTEXT;
|
||||
cinematicsMenuInfo.cin_tier3.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
cinematicsMenuInfo.cin_tier3.generic.x = 320;
|
||||
cinematicsMenuInfo.cin_tier3.generic.y = y;
|
||||
cinematicsMenuInfo.cin_tier3.generic.id = ID_CIN_TIER3;
|
||||
cinematicsMenuInfo.cin_tier3.generic.callback = UI_CinematicsMenu_Event;
|
||||
cinematicsMenuInfo.cin_tier3.string = "Tier 3";
|
||||
cinematicsMenuInfo.cin_tier3.color = color_red;
|
||||
cinematicsMenuInfo.cin_tier3.style = UI_CENTER;
|
||||
if( !UI_CanShowTierVideo( 3 ) ) {
|
||||
cinematicsMenuInfo.cin_tier3.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
|
||||
y += VERTICAL_SPACING;
|
||||
cinematicsMenuInfo.cin_tier4.generic.type = MTYPE_PTEXT;
|
||||
cinematicsMenuInfo.cin_tier4.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
cinematicsMenuInfo.cin_tier4.generic.x = 320;
|
||||
cinematicsMenuInfo.cin_tier4.generic.y = y;
|
||||
cinematicsMenuInfo.cin_tier4.generic.id = ID_CIN_TIER4;
|
||||
cinematicsMenuInfo.cin_tier4.generic.callback = UI_CinematicsMenu_Event;
|
||||
cinematicsMenuInfo.cin_tier4.string = "Tier 4";
|
||||
cinematicsMenuInfo.cin_tier4.color = color_red;
|
||||
cinematicsMenuInfo.cin_tier4.style = UI_CENTER;
|
||||
if( !UI_CanShowTierVideo( 4 ) ) {
|
||||
cinematicsMenuInfo.cin_tier4.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
|
||||
y += VERTICAL_SPACING;
|
||||
cinematicsMenuInfo.cin_tier5.generic.type = MTYPE_PTEXT;
|
||||
cinematicsMenuInfo.cin_tier5.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
cinematicsMenuInfo.cin_tier5.generic.x = 320;
|
||||
cinematicsMenuInfo.cin_tier5.generic.y = y;
|
||||
cinematicsMenuInfo.cin_tier5.generic.id = ID_CIN_TIER5;
|
||||
cinematicsMenuInfo.cin_tier5.generic.callback = UI_CinematicsMenu_Event;
|
||||
cinematicsMenuInfo.cin_tier5.string = "Tier 5";
|
||||
cinematicsMenuInfo.cin_tier5.color = color_red;
|
||||
cinematicsMenuInfo.cin_tier5.style = UI_CENTER;
|
||||
if( !UI_CanShowTierVideo( 5 ) ) {
|
||||
cinematicsMenuInfo.cin_tier5.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
|
||||
y += VERTICAL_SPACING;
|
||||
cinematicsMenuInfo.cin_tier6.generic.type = MTYPE_PTEXT;
|
||||
cinematicsMenuInfo.cin_tier6.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
cinematicsMenuInfo.cin_tier6.generic.x = 320;
|
||||
cinematicsMenuInfo.cin_tier6.generic.y = y;
|
||||
cinematicsMenuInfo.cin_tier6.generic.id = ID_CIN_TIER6;
|
||||
cinematicsMenuInfo.cin_tier6.generic.callback = UI_CinematicsMenu_Event;
|
||||
cinematicsMenuInfo.cin_tier6.string = "Tier 6";
|
||||
cinematicsMenuInfo.cin_tier6.color = color_red;
|
||||
cinematicsMenuInfo.cin_tier6.style = UI_CENTER;
|
||||
if( !UI_CanShowTierVideo( 6 ) ) {
|
||||
cinematicsMenuInfo.cin_tier6.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
|
||||
y += VERTICAL_SPACING;
|
||||
cinematicsMenuInfo.cin_tier7.generic.type = MTYPE_PTEXT;
|
||||
cinematicsMenuInfo.cin_tier7.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
cinematicsMenuInfo.cin_tier7.generic.x = 320;
|
||||
cinematicsMenuInfo.cin_tier7.generic.y = y;
|
||||
cinematicsMenuInfo.cin_tier7.generic.id = ID_CIN_TIER7;
|
||||
cinematicsMenuInfo.cin_tier7.generic.callback = UI_CinematicsMenu_Event;
|
||||
cinematicsMenuInfo.cin_tier7.string = "Tier 7";
|
||||
cinematicsMenuInfo.cin_tier7.color = color_red;
|
||||
cinematicsMenuInfo.cin_tier7.style = UI_CENTER;
|
||||
if( !UI_CanShowTierVideo( 7 ) ) {
|
||||
cinematicsMenuInfo.cin_tier7.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
|
||||
y += VERTICAL_SPACING;
|
||||
cinematicsMenuInfo.cin_end.generic.type = MTYPE_PTEXT;
|
||||
cinematicsMenuInfo.cin_end.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
cinematicsMenuInfo.cin_end.generic.x = 320;
|
||||
cinematicsMenuInfo.cin_end.generic.y = y;
|
||||
cinematicsMenuInfo.cin_end.generic.id = ID_CIN_END;
|
||||
cinematicsMenuInfo.cin_end.generic.callback = UI_CinematicsMenu_Event;
|
||||
cinematicsMenuInfo.cin_end.string = "END";
|
||||
cinematicsMenuInfo.cin_end.color = color_red;
|
||||
cinematicsMenuInfo.cin_end.style = UI_CENTER;
|
||||
if( !UI_CanShowTierVideo( 8 ) ) {
|
||||
cinematicsMenuInfo.cin_end.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
|
||||
cinematicsMenuInfo.back.generic.type = MTYPE_BITMAP;
|
||||
cinematicsMenuInfo.back.generic.name = ART_BACK0;
|
||||
cinematicsMenuInfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
cinematicsMenuInfo.back.generic.id = ID_BACK;
|
||||
cinematicsMenuInfo.back.generic.callback = UI_CinematicsMenu_BackEvent;
|
||||
cinematicsMenuInfo.back.generic.x = 0;
|
||||
cinematicsMenuInfo.back.generic.y = 480-64;
|
||||
cinematicsMenuInfo.back.width = 128;
|
||||
cinematicsMenuInfo.back.height = 64;
|
||||
cinematicsMenuInfo.back.focuspic = ART_BACK1;
|
||||
|
||||
Menu_AddItem( &cinematicsMenuInfo.menu, &cinematicsMenuInfo.banner );
|
||||
Menu_AddItem( &cinematicsMenuInfo.menu, &cinematicsMenuInfo.framel );
|
||||
Menu_AddItem( &cinematicsMenuInfo.menu, &cinematicsMenuInfo.framer );
|
||||
Menu_AddItem( &cinematicsMenuInfo.menu, &cinematicsMenuInfo.cin_idlogo );
|
||||
Menu_AddItem( &cinematicsMenuInfo.menu, &cinematicsMenuInfo.cin_intro );
|
||||
Menu_AddItem( &cinematicsMenuInfo.menu, &cinematicsMenuInfo.cin_tier1 );
|
||||
Menu_AddItem( &cinematicsMenuInfo.menu, &cinematicsMenuInfo.cin_tier2 );
|
||||
Menu_AddItem( &cinematicsMenuInfo.menu, &cinematicsMenuInfo.cin_tier3 );
|
||||
Menu_AddItem( &cinematicsMenuInfo.menu, &cinematicsMenuInfo.cin_tier4 );
|
||||
Menu_AddItem( &cinematicsMenuInfo.menu, &cinematicsMenuInfo.cin_tier5 );
|
||||
Menu_AddItem( &cinematicsMenuInfo.menu, &cinematicsMenuInfo.cin_tier6 );
|
||||
Menu_AddItem( &cinematicsMenuInfo.menu, &cinematicsMenuInfo.cin_tier7 );
|
||||
Menu_AddItem( &cinematicsMenuInfo.menu, &cinematicsMenuInfo.cin_end );
|
||||
Menu_AddItem( &cinematicsMenuInfo.menu, &cinematicsMenuInfo.back );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_CinematicsMenu_Cache
|
||||
=================
|
||||
*/
|
||||
void UI_CinematicsMenu_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( ART_BACK0 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK1 );
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMEL );
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMER );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_CinematicsMenu
|
||||
===============
|
||||
*/
|
||||
void UI_CinematicsMenu( void ) {
|
||||
UI_CinematicsMenu_Init();
|
||||
UI_PushMenu( &cinematicsMenuInfo.menu );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_CinematicsMenu_f
|
||||
===============
|
||||
*/
|
||||
void UI_CinematicsMenu_f( void ) {
|
||||
int n;
|
||||
|
||||
n = atoi( UI_Argv( 1 ) );
|
||||
UI_CinematicsMenu();
|
||||
Menu_SetCursorToItem( &cinematicsMenuInfo.menu, cinematicsMenuInfo.menu.items[n + 3] );
|
||||
}
|
||||
273
code/q3_ui/.svn/text-base/ui_confirm.c.svn-base
Executable file
273
code/q3_ui/.svn/text-base/ui_confirm.c.svn-base
Executable file
@@ -0,0 +1,273 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
/*
|
||||
=======================================================================
|
||||
|
||||
CONFIRMATION MENU
|
||||
|
||||
=======================================================================
|
||||
*/
|
||||
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define ART_CONFIRM_FRAME "menu/art/cut_frame"
|
||||
|
||||
#define ID_CONFIRM_NO 10
|
||||
#define ID_CONFIRM_YES 11
|
||||
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
|
||||
menutext_s no;
|
||||
menutext_s yes;
|
||||
|
||||
int slashX;
|
||||
const char * question;
|
||||
void (*draw)( void );
|
||||
void (*action)( qboolean result );
|
||||
|
||||
int style;
|
||||
const char **lines;
|
||||
} confirmMenu_t;
|
||||
|
||||
|
||||
static confirmMenu_t s_confirm;
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
ConfirmMenu_Event
|
||||
=================
|
||||
*/
|
||||
static void ConfirmMenu_Event( void* ptr, int event ) {
|
||||
qboolean result;
|
||||
|
||||
if( event != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
UI_PopMenu();
|
||||
|
||||
if( ((menucommon_s*)ptr)->id == ID_CONFIRM_NO ) {
|
||||
result = qfalse;
|
||||
}
|
||||
else {
|
||||
result = qtrue;
|
||||
}
|
||||
|
||||
if( s_confirm.action ) {
|
||||
s_confirm.action( result );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
ConfirmMenu_Key
|
||||
=================
|
||||
*/
|
||||
static sfxHandle_t ConfirmMenu_Key( int key ) {
|
||||
switch ( key ) {
|
||||
case K_KP_LEFTARROW:
|
||||
case K_LEFTARROW:
|
||||
case K_KP_RIGHTARROW:
|
||||
case K_RIGHTARROW:
|
||||
key = K_TAB;
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
case 'N':
|
||||
ConfirmMenu_Event( &s_confirm.no, QM_ACTIVATED );
|
||||
break;
|
||||
|
||||
case 'y':
|
||||
case 'Y':
|
||||
ConfirmMenu_Event( &s_confirm.yes, QM_ACTIVATED );
|
||||
break;
|
||||
}
|
||||
|
||||
return Menu_DefaultKey( &s_confirm.menu, key );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
MessaheMenu_Draw
|
||||
=================
|
||||
*/
|
||||
static void MessageMenu_Draw( void ) {
|
||||
int i,y;
|
||||
|
||||
UI_DrawNamedPic( 142, 118, 359, 256, ART_CONFIRM_FRAME );
|
||||
|
||||
y = 188;
|
||||
for(i=0; s_confirm.lines[i]; i++)
|
||||
{
|
||||
UI_DrawProportionalString( 320, y, s_confirm.lines[i], s_confirm.style, color_red );
|
||||
y += 18;
|
||||
}
|
||||
|
||||
Menu_Draw( &s_confirm.menu );
|
||||
|
||||
if( s_confirm.draw ) {
|
||||
s_confirm.draw();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
ConfirmMenu_Draw
|
||||
=================
|
||||
*/
|
||||
static void ConfirmMenu_Draw( void ) {
|
||||
UI_DrawNamedPic( 142, 118, 359, 256, ART_CONFIRM_FRAME );
|
||||
UI_DrawProportionalString( 320, 204, s_confirm.question, s_confirm.style, color_red );
|
||||
UI_DrawProportionalString( s_confirm.slashX, 265, "/", UI_LEFT|UI_INVERSE, color_red );
|
||||
|
||||
Menu_Draw( &s_confirm.menu );
|
||||
|
||||
if( s_confirm.draw ) {
|
||||
s_confirm.draw();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
ConfirmMenu_Cache
|
||||
=================
|
||||
*/
|
||||
void ConfirmMenu_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( ART_CONFIRM_FRAME );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_ConfirmMenu_Stlye
|
||||
=================
|
||||
*/
|
||||
void UI_ConfirmMenu_Style( const char *question, int style, void (*draw)( void ), void (*action)( qboolean result ) ) {
|
||||
uiClientState_t cstate;
|
||||
int n1, n2, n3;
|
||||
int l1, l2, l3;
|
||||
|
||||
// zero set all our globals
|
||||
memset( &s_confirm, 0, sizeof(s_confirm) );
|
||||
|
||||
ConfirmMenu_Cache();
|
||||
|
||||
n1 = UI_ProportionalStringWidth( "YES/NO" );
|
||||
n2 = UI_ProportionalStringWidth( "YES" ) + PROP_GAP_WIDTH;
|
||||
n3 = UI_ProportionalStringWidth( "/" ) + PROP_GAP_WIDTH;
|
||||
l1 = 320 - ( n1 / 2 );
|
||||
l2 = l1 + n2;
|
||||
l3 = l2 + n3;
|
||||
s_confirm.slashX = l2;
|
||||
|
||||
s_confirm.question = question;
|
||||
s_confirm.draw = draw;
|
||||
s_confirm.action = action;
|
||||
s_confirm.style = style;
|
||||
|
||||
s_confirm.menu.draw = ConfirmMenu_Draw;
|
||||
s_confirm.menu.key = ConfirmMenu_Key;
|
||||
s_confirm.menu.wrapAround = qtrue;
|
||||
|
||||
trap_GetClientState( &cstate );
|
||||
if ( cstate.connState >= CA_CONNECTED ) {
|
||||
s_confirm.menu.fullscreen = qfalse;
|
||||
}
|
||||
else {
|
||||
s_confirm.menu.fullscreen = qtrue;
|
||||
}
|
||||
|
||||
s_confirm.yes.generic.type = MTYPE_PTEXT;
|
||||
s_confirm.yes.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_confirm.yes.generic.callback = ConfirmMenu_Event;
|
||||
s_confirm.yes.generic.id = ID_CONFIRM_YES;
|
||||
s_confirm.yes.generic.x = l1;
|
||||
s_confirm.yes.generic.y = 264;
|
||||
s_confirm.yes.string = "YES";
|
||||
s_confirm.yes.color = color_red;
|
||||
s_confirm.yes.style = UI_LEFT;
|
||||
|
||||
s_confirm.no.generic.type = MTYPE_PTEXT;
|
||||
s_confirm.no.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_confirm.no.generic.callback = ConfirmMenu_Event;
|
||||
s_confirm.no.generic.id = ID_CONFIRM_NO;
|
||||
s_confirm.no.generic.x = l3;
|
||||
s_confirm.no.generic.y = 264;
|
||||
s_confirm.no.string = "NO";
|
||||
s_confirm.no.color = color_red;
|
||||
s_confirm.no.style = UI_LEFT;
|
||||
|
||||
Menu_AddItem( &s_confirm.menu, &s_confirm.yes );
|
||||
Menu_AddItem( &s_confirm.menu, &s_confirm.no );
|
||||
|
||||
UI_PushMenu( &s_confirm.menu );
|
||||
|
||||
Menu_SetCursorToItem( &s_confirm.menu, &s_confirm.no );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_ConfirmMenu
|
||||
=================
|
||||
*/
|
||||
void UI_ConfirmMenu( const char *question, void (*draw)( void ), void (*action)( qboolean result ) ) {
|
||||
UI_ConfirmMenu_Style(question, UI_CENTER|UI_INVERSE, draw, action);
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_Message
|
||||
hacked over from Confirm stuff
|
||||
=================
|
||||
*/
|
||||
void UI_Message( const char **lines ) {
|
||||
uiClientState_t cstate;
|
||||
int n1, l1;
|
||||
|
||||
// zero set all our globals
|
||||
memset( &s_confirm, 0, sizeof(s_confirm) );
|
||||
|
||||
ConfirmMenu_Cache();
|
||||
|
||||
n1 = UI_ProportionalStringWidth( "OK" );
|
||||
l1 = 320 - ( n1 / 2 );
|
||||
|
||||
s_confirm.lines = lines;
|
||||
s_confirm.style = UI_CENTER|UI_INVERSE|UI_SMALLFONT;
|
||||
|
||||
s_confirm.menu.draw = MessageMenu_Draw;
|
||||
s_confirm.menu.key = ConfirmMenu_Key;
|
||||
s_confirm.menu.wrapAround = qtrue;
|
||||
|
||||
trap_GetClientState( &cstate );
|
||||
if ( cstate.connState >= CA_CONNECTED ) {
|
||||
s_confirm.menu.fullscreen = qfalse;
|
||||
}
|
||||
else {
|
||||
s_confirm.menu.fullscreen = qtrue;
|
||||
}
|
||||
|
||||
s_confirm.yes.generic.type = MTYPE_PTEXT;
|
||||
s_confirm.yes.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_confirm.yes.generic.callback = ConfirmMenu_Event;
|
||||
s_confirm.yes.generic.id = ID_CONFIRM_YES;
|
||||
s_confirm.yes.generic.x = l1;
|
||||
s_confirm.yes.generic.y = 280;
|
||||
s_confirm.yes.string = "OK";
|
||||
s_confirm.yes.color = color_red;
|
||||
s_confirm.yes.style = UI_LEFT;
|
||||
|
||||
Menu_AddItem( &s_confirm.menu, &s_confirm.yes );
|
||||
|
||||
UI_PushMenu( &s_confirm.menu );
|
||||
|
||||
Menu_SetCursorToItem( &s_confirm.menu, &s_confirm.yes );
|
||||
}
|
||||
262
code/q3_ui/.svn/text-base/ui_connect.c.svn-base
Executable file
262
code/q3_ui/.svn/text-base/ui_connect.c.svn-base
Executable file
@@ -0,0 +1,262 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
#include "ui_local.h"
|
||||
|
||||
/*
|
||||
===============================================================================
|
||||
|
||||
CONNECTION SCREEN
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
qboolean passwordNeeded = qtrue;
|
||||
menufield_s passwordField;
|
||||
|
||||
static connstate_t lastConnState;
|
||||
static char lastLoadingText[MAX_INFO_VALUE];
|
||||
|
||||
static void UI_ReadableSize ( char *buf, int bufsize, int value )
|
||||
{
|
||||
if (value > 1024*1024*1024 ) { // gigs
|
||||
Com_sprintf( buf, bufsize, "%d", value / (1024*1024*1024) );
|
||||
Com_sprintf( buf+strlen(buf), bufsize-strlen(buf), ".%02d GB",
|
||||
(value % (1024*1024*1024))*100 / (1024*1024*1024) );
|
||||
} else if (value > 1024*1024 ) { // megs
|
||||
Com_sprintf( buf, bufsize, "%d", value / (1024*1024) );
|
||||
Com_sprintf( buf+strlen(buf), bufsize-strlen(buf), ".%02d MB",
|
||||
(value % (1024*1024))*100 / (1024*1024) );
|
||||
} else if (value > 1024 ) { // kilos
|
||||
Com_sprintf( buf, bufsize, "%d KB", value / 1024 );
|
||||
} else { // bytes
|
||||
Com_sprintf( buf, bufsize, "%d bytes", value );
|
||||
}
|
||||
}
|
||||
|
||||
// Assumes time is in msec
|
||||
static void UI_PrintTime ( char *buf, int bufsize, int time ) {
|
||||
time /= 1000; // change to seconds
|
||||
|
||||
if (time > 3600) { // in the hours range
|
||||
Com_sprintf( buf, bufsize, "%d hr %d min", time / 3600, (time % 3600) / 60 );
|
||||
} else if (time > 60) { // mins
|
||||
Com_sprintf( buf, bufsize, "%d min %d sec", time / 60, time % 60 );
|
||||
} else { // secs
|
||||
Com_sprintf( buf, bufsize, "%d sec", time );
|
||||
}
|
||||
}
|
||||
|
||||
static void UI_DisplayDownloadInfo( const char *downloadName ) {
|
||||
static char dlText[] = "Downloading:";
|
||||
static char etaText[] = "Estimated time left:";
|
||||
static char xferText[] = "Transfer rate:";
|
||||
|
||||
int downloadSize, downloadCount, downloadTime;
|
||||
char dlSizeBuf[64], totalSizeBuf[64], xferRateBuf[64], dlTimeBuf[64];
|
||||
int xferRate;
|
||||
int width, leftWidth;
|
||||
int style = UI_LEFT|UI_SMALLFONT|UI_DROPSHADOW;
|
||||
const char *s;
|
||||
|
||||
downloadSize = trap_Cvar_VariableValue( "cl_downloadSize" );
|
||||
downloadCount = trap_Cvar_VariableValue( "cl_downloadCount" );
|
||||
downloadTime = trap_Cvar_VariableValue( "cl_downloadTime" );
|
||||
|
||||
#if 0 // bk010104
|
||||
fprintf( stderr, "\n\n-----------------------------------------------\n");
|
||||
fprintf( stderr, "DB: downloadSize: %16d\n", downloadSize );
|
||||
fprintf( stderr, "DB: downloadCount: %16d\n", downloadCount );
|
||||
fprintf( stderr, "DB: downloadTime: %16d\n", downloadTime );
|
||||
fprintf( stderr, "DB: UI realtime: %16d\n", uis.realtime ); // bk
|
||||
fprintf( stderr, "DB: UI frametime: %16d\n", uis.frametime ); // bk
|
||||
#endif
|
||||
|
||||
leftWidth = width = UI_ProportionalStringWidth( dlText ) * UI_ProportionalSizeScale( style );
|
||||
width = UI_ProportionalStringWidth( etaText ) * UI_ProportionalSizeScale( style );
|
||||
if (width > leftWidth) leftWidth = width;
|
||||
width = UI_ProportionalStringWidth( xferText ) * UI_ProportionalSizeScale( style );
|
||||
if (width > leftWidth) leftWidth = width;
|
||||
leftWidth += 16;
|
||||
|
||||
UI_DrawProportionalString( 8, 128, dlText, style, color_white );
|
||||
UI_DrawProportionalString( 8, 160, etaText, style, color_white );
|
||||
UI_DrawProportionalString( 8, 224, xferText, style, color_white );
|
||||
|
||||
if (downloadSize > 0) {
|
||||
s = va( "%s (%d%%)", downloadName, downloadCount * 100 / downloadSize );
|
||||
} else {
|
||||
s = downloadName;
|
||||
}
|
||||
|
||||
UI_DrawProportionalString( leftWidth, 128, s, style, color_white );
|
||||
|
||||
UI_ReadableSize( dlSizeBuf, sizeof dlSizeBuf, downloadCount );
|
||||
UI_ReadableSize( totalSizeBuf, sizeof totalSizeBuf, downloadSize );
|
||||
|
||||
if (downloadCount < 4096 || !downloadTime) {
|
||||
UI_DrawProportionalString( leftWidth, 160, "estimating", style, color_white );
|
||||
UI_DrawProportionalString( leftWidth, 192,
|
||||
va("(%s of %s copied)", dlSizeBuf, totalSizeBuf), style, color_white );
|
||||
} else {
|
||||
// bk010108
|
||||
//float elapsedTime = (float)(uis.realtime - downloadTime); // current - start (msecs)
|
||||
//elapsedTime = elapsedTime * 0.001f; // in seconds
|
||||
//if ( elapsedTime <= 0.0f ) elapsedTime == 0.0f;
|
||||
if ( (uis.realtime - downloadTime) / 1000) {
|
||||
xferRate = downloadCount / ((uis.realtime - downloadTime) / 1000);
|
||||
//xferRate = (int)( ((float)downloadCount) / elapsedTime);
|
||||
} else {
|
||||
xferRate = 0;
|
||||
}
|
||||
|
||||
//fprintf( stderr, "DB: elapsedTime: %16.8f\n", elapsedTime ); // bk
|
||||
//fprintf( stderr, "DB: xferRate: %16d\n", xferRate ); // bk
|
||||
|
||||
UI_ReadableSize( xferRateBuf, sizeof xferRateBuf, xferRate );
|
||||
|
||||
// Extrapolate estimated completion time
|
||||
if (downloadSize && xferRate) {
|
||||
int n = downloadSize / xferRate; // estimated time for entire d/l in secs
|
||||
|
||||
// We do it in K (/1024) because we'd overflow around 4MB
|
||||
n = (n - (((downloadCount/1024) * n) / (downloadSize/1024))) * 1000;
|
||||
|
||||
UI_PrintTime ( dlTimeBuf, sizeof dlTimeBuf, n ); // bk010104
|
||||
//(n - (((downloadCount/1024) * n) / (downloadSize/1024))) * 1000);
|
||||
|
||||
UI_DrawProportionalString( leftWidth, 160,
|
||||
dlTimeBuf, style, color_white );
|
||||
UI_DrawProportionalString( leftWidth, 192,
|
||||
va("(%s of %s copied)", dlSizeBuf, totalSizeBuf), style, color_white );
|
||||
} else {
|
||||
UI_DrawProportionalString( leftWidth, 160,
|
||||
"estimating", style, color_white );
|
||||
if (downloadSize) {
|
||||
UI_DrawProportionalString( leftWidth, 192,
|
||||
va("(%s of %s copied)", dlSizeBuf, totalSizeBuf), style, color_white );
|
||||
} else {
|
||||
UI_DrawProportionalString( leftWidth, 192,
|
||||
va("(%s copied)", dlSizeBuf), style, color_white );
|
||||
}
|
||||
}
|
||||
|
||||
if (xferRate) {
|
||||
UI_DrawProportionalString( leftWidth, 224,
|
||||
va("%s/Sec", xferRateBuf), style, color_white );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
========================
|
||||
UI_DrawConnectScreen
|
||||
|
||||
This will also be overlaid on the cgame info screen during loading
|
||||
to prevent it from blinking away too rapidly on local or lan games.
|
||||
========================
|
||||
*/
|
||||
void UI_DrawConnectScreen( qboolean overlay ) {
|
||||
char *s;
|
||||
uiClientState_t cstate;
|
||||
char info[MAX_INFO_VALUE];
|
||||
|
||||
Menu_Cache();
|
||||
|
||||
if ( !overlay ) {
|
||||
// draw the dialog background
|
||||
UI_SetColor( color_white );
|
||||
UI_DrawHandlePic( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, uis.menuBackShader );
|
||||
}
|
||||
|
||||
// see what information we should display
|
||||
trap_GetClientState( &cstate );
|
||||
|
||||
info[0] = '\0';
|
||||
if( trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) ) ) {
|
||||
UI_DrawProportionalString( 320, 16, va( "Loading %s", Info_ValueForKey( info, "mapname" ) ), UI_BIGFONT|UI_CENTER|UI_DROPSHADOW, color_white );
|
||||
}
|
||||
|
||||
UI_DrawProportionalString( 320, 64, va("Connecting to %s", cstate.servername), UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );
|
||||
//UI_DrawProportionalString( 320, 96, "Press Esc to abort", UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );
|
||||
|
||||
// display global MOTD at bottom
|
||||
UI_DrawProportionalString( SCREEN_WIDTH/2, SCREEN_HEIGHT-32,
|
||||
Info_ValueForKey( cstate.updateInfoString, "motd" ), UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );
|
||||
|
||||
// print any server info (server full, bad version, etc)
|
||||
if ( cstate.connState < CA_CONNECTED ) {
|
||||
UI_DrawProportionalString_AutoWrapped( 320, 192, 630, 20, cstate.messageString, UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );
|
||||
}
|
||||
|
||||
#if 0
|
||||
// display password field
|
||||
if ( passwordNeeded ) {
|
||||
s_ingame_menu.x = SCREEN_WIDTH * 0.50 - 128;
|
||||
s_ingame_menu.nitems = 0;
|
||||
s_ingame_menu.wrapAround = qtrue;
|
||||
|
||||
passwordField.generic.type = MTYPE_FIELD;
|
||||
passwordField.generic.name = "Password:";
|
||||
passwordField.generic.callback = 0;
|
||||
passwordField.generic.x = 10;
|
||||
passwordField.generic.y = 180;
|
||||
Field_Clear( &passwordField.field );
|
||||
passwordField.width = 256;
|
||||
passwordField.field.widthInChars = 16;
|
||||
Q_strncpyz( passwordField.field.buffer, Cvar_VariableString("password"),
|
||||
sizeof(passwordField.field.buffer) );
|
||||
|
||||
Menu_AddItem( &s_ingame_menu, ( void * ) &s_customize_player_action );
|
||||
|
||||
MField_Draw( &passwordField );
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( lastConnState > cstate.connState ) {
|
||||
lastLoadingText[0] = '\0';
|
||||
}
|
||||
lastConnState = cstate.connState;
|
||||
|
||||
switch ( cstate.connState ) {
|
||||
case CA_CONNECTING:
|
||||
s = va("Awaiting challenge...%i", cstate.connectPacketCount);
|
||||
break;
|
||||
case CA_CHALLENGING:
|
||||
s = va("Awaiting connection...%i", cstate.connectPacketCount);
|
||||
break;
|
||||
case CA_CONNECTED: {
|
||||
char downloadName[MAX_INFO_VALUE];
|
||||
|
||||
trap_Cvar_VariableStringBuffer( "cl_downloadName", downloadName, sizeof(downloadName) );
|
||||
if (*downloadName) {
|
||||
UI_DisplayDownloadInfo( downloadName );
|
||||
return;
|
||||
}
|
||||
}
|
||||
s = "Awaiting gamestate...";
|
||||
break;
|
||||
case CA_LOADING:
|
||||
return;
|
||||
case CA_PRIMED:
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
UI_DrawProportionalString( 320, 128, s, UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, color_white );
|
||||
|
||||
// password required / connection rejected information goes here
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===================
|
||||
UI_KeyConnect
|
||||
===================
|
||||
*/
|
||||
void UI_KeyConnect( int key ) {
|
||||
if ( key == K_ESCAPE ) {
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, "disconnect\n" );
|
||||
return;
|
||||
}
|
||||
}
|
||||
1647
code/q3_ui/.svn/text-base/ui_controls2.c.svn-base
Executable file
1647
code/q3_ui/.svn/text-base/ui_controls2.c.svn-base
Executable file
File diff suppressed because it is too large
Load Diff
109
code/q3_ui/.svn/text-base/ui_credits.c.svn-base
Executable file
109
code/q3_ui/.svn/text-base/ui_credits.c.svn-base
Executable file
@@ -0,0 +1,109 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
/*
|
||||
=======================================================================
|
||||
|
||||
CREDITS
|
||||
|
||||
=======================================================================
|
||||
*/
|
||||
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
} creditsmenu_t;
|
||||
|
||||
static creditsmenu_t s_credits;
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_CreditMenu_Key
|
||||
=================
|
||||
*/
|
||||
static sfxHandle_t UI_CreditMenu_Key( int key ) {
|
||||
if( key & K_CHAR_FLAG ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, "quit\n" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_CreditMenu_Draw
|
||||
===============
|
||||
*/
|
||||
static void UI_CreditMenu_Draw( void ) {
|
||||
int y;
|
||||
|
||||
y = 12;
|
||||
UI_DrawProportionalString( 320, y, "id Software is:", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
|
||||
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Programming", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "John Carmack, Robert A. Duffy, Jim Dose'", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
|
||||
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Art", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Adrian Carmack, Kevin Cloud,", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Kenneth Scott, Seneca Menard, Fred Nilsson", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
|
||||
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Game Designer", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Graeme Devine", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
|
||||
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Level Design", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Tim Willits, Christian Antkow, Paul Jaquays", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
|
||||
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "CEO", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Todd Hollenshead", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
|
||||
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Director of Business Development", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Marty Stratton", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
|
||||
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Biz Assist and id Mom", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Donna Jackson", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
|
||||
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Development Assistance", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Eric Webb", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
|
||||
y += 1.35 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawString( 320, y, "To order: 1-800-idgames www.quake3arena.com www.idsoftware.com", UI_CENTER|UI_SMALLFONT, color_red );
|
||||
y += SMALLCHAR_HEIGHT;
|
||||
UI_DrawString( 320, y, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color_red );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_CreditMenu
|
||||
===============
|
||||
*/
|
||||
void UI_CreditMenu( void ) {
|
||||
memset( &s_credits, 0 ,sizeof(s_credits) );
|
||||
|
||||
s_credits.menu.draw = UI_CreditMenu_Draw;
|
||||
s_credits.menu.key = UI_CreditMenu_Key;
|
||||
s_credits.menu.fullscreen = qtrue;
|
||||
UI_PushMenu ( &s_credits.menu );
|
||||
}
|
||||
271
code/q3_ui/.svn/text-base/ui_demo2.c.svn-base
Executable file
271
code/q3_ui/.svn/text-base/ui_demo2.c.svn-base
Executable file
@@ -0,0 +1,271 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
/*
|
||||
=======================================================================
|
||||
|
||||
DEMOS MENU
|
||||
|
||||
=======================================================================
|
||||
*/
|
||||
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define ART_BACK0 "menu/art/back_0"
|
||||
#define ART_BACK1 "menu/art/back_1"
|
||||
#define ART_GO0 "menu/art/play_0"
|
||||
#define ART_GO1 "menu/art/play_1"
|
||||
#define ART_FRAMEL "menu/art/frame2_l"
|
||||
#define ART_FRAMER "menu/art/frame1_r"
|
||||
#define ART_ARROWS "menu/art/arrows_horz_0"
|
||||
#define ART_ARROWLEFT "menu/art/arrows_horz_left"
|
||||
#define ART_ARROWRIGHT "menu/art/arrows_horz_right"
|
||||
|
||||
#define MAX_DEMOS 128
|
||||
#define NAMEBUFSIZE ( MAX_DEMOS * 16 )
|
||||
|
||||
#define ID_BACK 10
|
||||
#define ID_GO 11
|
||||
#define ID_LIST 12
|
||||
#define ID_RIGHT 13
|
||||
#define ID_LEFT 14
|
||||
|
||||
#define ARROWS_WIDTH 128
|
||||
#define ARROWS_HEIGHT 48
|
||||
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
|
||||
menutext_s banner;
|
||||
menubitmap_s framel;
|
||||
menubitmap_s framer;
|
||||
|
||||
menulist_s list;
|
||||
|
||||
menubitmap_s arrows;
|
||||
menubitmap_s left;
|
||||
menubitmap_s right;
|
||||
menubitmap_s back;
|
||||
menubitmap_s go;
|
||||
|
||||
int numDemos;
|
||||
char names[NAMEBUFSIZE];
|
||||
char *demolist[MAX_DEMOS];
|
||||
} demos_t;
|
||||
|
||||
static demos_t s_demos;
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
Demos_MenuEvent
|
||||
===============
|
||||
*/
|
||||
static void Demos_MenuEvent( void *ptr, int event ) {
|
||||
if( event != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch( ((menucommon_s*)ptr)->id ) {
|
||||
case ID_GO:
|
||||
UI_ForceMenuOff ();
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va( "demo %s\n",
|
||||
s_demos.list.itemnames[s_demos.list.curvalue]) );
|
||||
break;
|
||||
|
||||
case ID_BACK:
|
||||
UI_PopMenu();
|
||||
break;
|
||||
|
||||
case ID_LEFT:
|
||||
ScrollList_Key( &s_demos.list, K_LEFTARROW );
|
||||
break;
|
||||
|
||||
case ID_RIGHT:
|
||||
ScrollList_Key( &s_demos.list, K_RIGHTARROW );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_DemosMenu_Key
|
||||
=================
|
||||
*/
|
||||
static sfxHandle_t UI_DemosMenu_Key( int key ) {
|
||||
menucommon_s *item;
|
||||
|
||||
item = Menu_ItemAtCursor( &s_demos.menu );
|
||||
|
||||
return Menu_DefaultKey( &s_demos.menu, key );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
Demos_MenuInit
|
||||
===============
|
||||
*/
|
||||
static void Demos_MenuInit( void ) {
|
||||
int i;
|
||||
int len;
|
||||
char *demoname, extension[32];
|
||||
|
||||
memset( &s_demos, 0 ,sizeof(demos_t) );
|
||||
s_demos.menu.key = UI_DemosMenu_Key;
|
||||
|
||||
Demos_Cache();
|
||||
|
||||
s_demos.menu.fullscreen = qtrue;
|
||||
s_demos.menu.wrapAround = qtrue;
|
||||
|
||||
s_demos.banner.generic.type = MTYPE_BTEXT;
|
||||
s_demos.banner.generic.x = 320;
|
||||
s_demos.banner.generic.y = 16;
|
||||
s_demos.banner.string = "DEMOS";
|
||||
s_demos.banner.color = color_white;
|
||||
s_demos.banner.style = UI_CENTER;
|
||||
|
||||
s_demos.framel.generic.type = MTYPE_BITMAP;
|
||||
s_demos.framel.generic.name = ART_FRAMEL;
|
||||
s_demos.framel.generic.flags = QMF_INACTIVE;
|
||||
s_demos.framel.generic.x = 0;
|
||||
s_demos.framel.generic.y = 78;
|
||||
s_demos.framel.width = 256;
|
||||
s_demos.framel.height = 329;
|
||||
|
||||
s_demos.framer.generic.type = MTYPE_BITMAP;
|
||||
s_demos.framer.generic.name = ART_FRAMER;
|
||||
s_demos.framer.generic.flags = QMF_INACTIVE;
|
||||
s_demos.framer.generic.x = 376;
|
||||
s_demos.framer.generic.y = 76;
|
||||
s_demos.framer.width = 256;
|
||||
s_demos.framer.height = 334;
|
||||
|
||||
s_demos.arrows.generic.type = MTYPE_BITMAP;
|
||||
s_demos.arrows.generic.name = ART_ARROWS;
|
||||
s_demos.arrows.generic.flags = QMF_INACTIVE;
|
||||
s_demos.arrows.generic.x = 320-ARROWS_WIDTH/2;
|
||||
s_demos.arrows.generic.y = 400;
|
||||
s_demos.arrows.width = ARROWS_WIDTH;
|
||||
s_demos.arrows.height = ARROWS_HEIGHT;
|
||||
|
||||
s_demos.left.generic.type = MTYPE_BITMAP;
|
||||
s_demos.left.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_MOUSEONLY;
|
||||
s_demos.left.generic.x = 320-ARROWS_WIDTH/2;
|
||||
s_demos.left.generic.y = 400;
|
||||
s_demos.left.generic.id = ID_LEFT;
|
||||
s_demos.left.generic.callback = Demos_MenuEvent;
|
||||
s_demos.left.width = ARROWS_WIDTH/2;
|
||||
s_demos.left.height = ARROWS_HEIGHT;
|
||||
s_demos.left.focuspic = ART_ARROWLEFT;
|
||||
|
||||
s_demos.right.generic.type = MTYPE_BITMAP;
|
||||
s_demos.right.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_MOUSEONLY;
|
||||
s_demos.right.generic.x = 320;
|
||||
s_demos.right.generic.y = 400;
|
||||
s_demos.right.generic.id = ID_RIGHT;
|
||||
s_demos.right.generic.callback = Demos_MenuEvent;
|
||||
s_demos.right.width = ARROWS_WIDTH/2;
|
||||
s_demos.right.height = ARROWS_HEIGHT;
|
||||
s_demos.right.focuspic = ART_ARROWRIGHT;
|
||||
|
||||
s_demos.back.generic.type = MTYPE_BITMAP;
|
||||
s_demos.back.generic.name = ART_BACK0;
|
||||
s_demos.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_demos.back.generic.id = ID_BACK;
|
||||
s_demos.back.generic.callback = Demos_MenuEvent;
|
||||
s_demos.back.generic.x = 0;
|
||||
s_demos.back.generic.y = 480-64;
|
||||
s_demos.back.width = 128;
|
||||
s_demos.back.height = 64;
|
||||
s_demos.back.focuspic = ART_BACK1;
|
||||
|
||||
s_demos.go.generic.type = MTYPE_BITMAP;
|
||||
s_demos.go.generic.name = ART_GO0;
|
||||
s_demos.go.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_demos.go.generic.id = ID_GO;
|
||||
s_demos.go.generic.callback = Demos_MenuEvent;
|
||||
s_demos.go.generic.x = 640;
|
||||
s_demos.go.generic.y = 480-64;
|
||||
s_demos.go.width = 128;
|
||||
s_demos.go.height = 64;
|
||||
s_demos.go.focuspic = ART_GO1;
|
||||
|
||||
s_demos.list.generic.type = MTYPE_SCROLLLIST;
|
||||
s_demos.list.generic.flags = QMF_PULSEIFFOCUS;
|
||||
s_demos.list.generic.callback = Demos_MenuEvent;
|
||||
s_demos.list.generic.id = ID_LIST;
|
||||
s_demos.list.generic.x = 118;
|
||||
s_demos.list.generic.y = 130;
|
||||
s_demos.list.width = 16;
|
||||
s_demos.list.height = 14;
|
||||
Com_sprintf(extension, sizeof(extension), "dm_%d", (int)trap_Cvar_VariableValue( "protocol" ) );
|
||||
s_demos.list.numitems = trap_FS_GetFileList( "demos", extension, s_demos.names, NAMEBUFSIZE );
|
||||
s_demos.list.itemnames = (const char **)s_demos.demolist;
|
||||
s_demos.list.columns = 3;
|
||||
|
||||
if (!s_demos.list.numitems) {
|
||||
strcpy( s_demos.names, "No Demos Found." );
|
||||
s_demos.list.numitems = 1;
|
||||
|
||||
//degenerate case, not selectable
|
||||
s_demos.go.generic.flags |= (QMF_INACTIVE|QMF_HIDDEN);
|
||||
}
|
||||
else if (s_demos.list.numitems > MAX_DEMOS)
|
||||
s_demos.list.numitems = MAX_DEMOS;
|
||||
|
||||
demoname = s_demos.names;
|
||||
for ( i = 0; i < s_demos.list.numitems; i++ ) {
|
||||
s_demos.list.itemnames[i] = demoname;
|
||||
|
||||
// strip extension
|
||||
len = strlen( demoname );
|
||||
if (!Q_stricmp(demoname + len - 4,".dm3"))
|
||||
demoname[len-4] = '\0';
|
||||
|
||||
Q_strupr(demoname);
|
||||
|
||||
demoname += len + 1;
|
||||
}
|
||||
|
||||
Menu_AddItem( &s_demos.menu, &s_demos.banner );
|
||||
Menu_AddItem( &s_demos.menu, &s_demos.framel );
|
||||
Menu_AddItem( &s_demos.menu, &s_demos.framer );
|
||||
Menu_AddItem( &s_demos.menu, &s_demos.list );
|
||||
Menu_AddItem( &s_demos.menu, &s_demos.arrows );
|
||||
Menu_AddItem( &s_demos.menu, &s_demos.left );
|
||||
Menu_AddItem( &s_demos.menu, &s_demos.right );
|
||||
Menu_AddItem( &s_demos.menu, &s_demos.back );
|
||||
Menu_AddItem( &s_demos.menu, &s_demos.go );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
Demos_Cache
|
||||
=================
|
||||
*/
|
||||
void Demos_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( ART_BACK0 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK1 );
|
||||
trap_R_RegisterShaderNoMip( ART_GO0 );
|
||||
trap_R_RegisterShaderNoMip( ART_GO1 );
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMEL );
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMER );
|
||||
trap_R_RegisterShaderNoMip( ART_ARROWS );
|
||||
trap_R_RegisterShaderNoMip( ART_ARROWLEFT );
|
||||
trap_R_RegisterShaderNoMip( ART_ARROWRIGHT );
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_DemosMenu
|
||||
===============
|
||||
*/
|
||||
void UI_DemosMenu( void ) {
|
||||
Demos_MenuInit();
|
||||
UI_PushMenu( &s_demos.menu );
|
||||
}
|
||||
245
code/q3_ui/.svn/text-base/ui_display.c.svn-base
Executable file
245
code/q3_ui/.svn/text-base/ui_display.c.svn-base
Executable file
@@ -0,0 +1,245 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
/*
|
||||
=======================================================================
|
||||
|
||||
DISPLAY OPTIONS MENU
|
||||
|
||||
=======================================================================
|
||||
*/
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define ART_FRAMEL "menu/art/frame2_l"
|
||||
#define ART_FRAMER "menu/art/frame1_r"
|
||||
#define ART_BACK0 "menu/art/back_0"
|
||||
#define ART_BACK1 "menu/art/back_1"
|
||||
|
||||
#define ID_GRAPHICS 10
|
||||
#define ID_DISPLAY 11
|
||||
#define ID_SOUND 12
|
||||
#define ID_NETWORK 13
|
||||
#define ID_BRIGHTNESS 14
|
||||
#define ID_SCREENSIZE 15
|
||||
#define ID_BACK 16
|
||||
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
|
||||
menutext_s banner;
|
||||
menubitmap_s framel;
|
||||
menubitmap_s framer;
|
||||
|
||||
menutext_s graphics;
|
||||
menutext_s display;
|
||||
menutext_s sound;
|
||||
menutext_s network;
|
||||
|
||||
menuslider_s brightness;
|
||||
menuslider_s screensize;
|
||||
|
||||
menubitmap_s back;
|
||||
} displayOptionsInfo_t;
|
||||
|
||||
static displayOptionsInfo_t displayOptionsInfo;
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_DisplayOptionsMenu_Event
|
||||
=================
|
||||
*/
|
||||
static void UI_DisplayOptionsMenu_Event( void* ptr, int event ) {
|
||||
if( event != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch( ((menucommon_s*)ptr)->id ) {
|
||||
case ID_GRAPHICS:
|
||||
UI_PopMenu();
|
||||
UI_GraphicsOptionsMenu();
|
||||
break;
|
||||
|
||||
case ID_DISPLAY:
|
||||
break;
|
||||
|
||||
case ID_SOUND:
|
||||
UI_PopMenu();
|
||||
UI_SoundOptionsMenu();
|
||||
break;
|
||||
|
||||
case ID_NETWORK:
|
||||
UI_PopMenu();
|
||||
UI_NetworkOptionsMenu();
|
||||
break;
|
||||
|
||||
case ID_BRIGHTNESS:
|
||||
trap_Cvar_SetValue( "r_gamma", displayOptionsInfo.brightness.curvalue / 10.0f );
|
||||
break;
|
||||
|
||||
case ID_SCREENSIZE:
|
||||
trap_Cvar_SetValue( "cg_viewsize", displayOptionsInfo.screensize.curvalue * 10 );
|
||||
break;
|
||||
|
||||
case ID_BACK:
|
||||
UI_PopMenu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_DisplayOptionsMenu_Init
|
||||
===============
|
||||
*/
|
||||
static void UI_DisplayOptionsMenu_Init( void ) {
|
||||
int y;
|
||||
|
||||
memset( &displayOptionsInfo, 0, sizeof(displayOptionsInfo) );
|
||||
|
||||
UI_DisplayOptionsMenu_Cache();
|
||||
displayOptionsInfo.menu.wrapAround = qtrue;
|
||||
displayOptionsInfo.menu.fullscreen = qtrue;
|
||||
|
||||
displayOptionsInfo.banner.generic.type = MTYPE_BTEXT;
|
||||
displayOptionsInfo.banner.generic.flags = QMF_CENTER_JUSTIFY;
|
||||
displayOptionsInfo.banner.generic.x = 320;
|
||||
displayOptionsInfo.banner.generic.y = 16;
|
||||
displayOptionsInfo.banner.string = "SYSTEM SETUP";
|
||||
displayOptionsInfo.banner.color = color_white;
|
||||
displayOptionsInfo.banner.style = UI_CENTER;
|
||||
|
||||
displayOptionsInfo.framel.generic.type = MTYPE_BITMAP;
|
||||
displayOptionsInfo.framel.generic.name = ART_FRAMEL;
|
||||
displayOptionsInfo.framel.generic.flags = QMF_INACTIVE;
|
||||
displayOptionsInfo.framel.generic.x = 0;
|
||||
displayOptionsInfo.framel.generic.y = 78;
|
||||
displayOptionsInfo.framel.width = 256;
|
||||
displayOptionsInfo.framel.height = 329;
|
||||
|
||||
displayOptionsInfo.framer.generic.type = MTYPE_BITMAP;
|
||||
displayOptionsInfo.framer.generic.name = ART_FRAMER;
|
||||
displayOptionsInfo.framer.generic.flags = QMF_INACTIVE;
|
||||
displayOptionsInfo.framer.generic.x = 376;
|
||||
displayOptionsInfo.framer.generic.y = 76;
|
||||
displayOptionsInfo.framer.width = 256;
|
||||
displayOptionsInfo.framer.height = 334;
|
||||
|
||||
displayOptionsInfo.graphics.generic.type = MTYPE_PTEXT;
|
||||
displayOptionsInfo.graphics.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
displayOptionsInfo.graphics.generic.id = ID_GRAPHICS;
|
||||
displayOptionsInfo.graphics.generic.callback = UI_DisplayOptionsMenu_Event;
|
||||
displayOptionsInfo.graphics.generic.x = 216;
|
||||
displayOptionsInfo.graphics.generic.y = 240 - 2 * PROP_HEIGHT;
|
||||
displayOptionsInfo.graphics.string = "GRAPHICS";
|
||||
displayOptionsInfo.graphics.style = UI_RIGHT;
|
||||
displayOptionsInfo.graphics.color = color_red;
|
||||
|
||||
displayOptionsInfo.display.generic.type = MTYPE_PTEXT;
|
||||
displayOptionsInfo.display.generic.flags = QMF_RIGHT_JUSTIFY;
|
||||
displayOptionsInfo.display.generic.id = ID_DISPLAY;
|
||||
displayOptionsInfo.display.generic.callback = UI_DisplayOptionsMenu_Event;
|
||||
displayOptionsInfo.display.generic.x = 216;
|
||||
displayOptionsInfo.display.generic.y = 240 - PROP_HEIGHT;
|
||||
displayOptionsInfo.display.string = "DISPLAY";
|
||||
displayOptionsInfo.display.style = UI_RIGHT;
|
||||
displayOptionsInfo.display.color = color_red;
|
||||
|
||||
displayOptionsInfo.sound.generic.type = MTYPE_PTEXT;
|
||||
displayOptionsInfo.sound.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
displayOptionsInfo.sound.generic.id = ID_SOUND;
|
||||
displayOptionsInfo.sound.generic.callback = UI_DisplayOptionsMenu_Event;
|
||||
displayOptionsInfo.sound.generic.x = 216;
|
||||
displayOptionsInfo.sound.generic.y = 240;
|
||||
displayOptionsInfo.sound.string = "SOUND";
|
||||
displayOptionsInfo.sound.style = UI_RIGHT;
|
||||
displayOptionsInfo.sound.color = color_red;
|
||||
|
||||
displayOptionsInfo.network.generic.type = MTYPE_PTEXT;
|
||||
displayOptionsInfo.network.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
displayOptionsInfo.network.generic.id = ID_NETWORK;
|
||||
displayOptionsInfo.network.generic.callback = UI_DisplayOptionsMenu_Event;
|
||||
displayOptionsInfo.network.generic.x = 216;
|
||||
displayOptionsInfo.network.generic.y = 240 + PROP_HEIGHT;
|
||||
displayOptionsInfo.network.string = "NETWORK";
|
||||
displayOptionsInfo.network.style = UI_RIGHT;
|
||||
displayOptionsInfo.network.color = color_red;
|
||||
|
||||
y = 240 - 1 * (BIGCHAR_HEIGHT+2);
|
||||
displayOptionsInfo.brightness.generic.type = MTYPE_SLIDER;
|
||||
displayOptionsInfo.brightness.generic.name = "Brightness:";
|
||||
displayOptionsInfo.brightness.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
displayOptionsInfo.brightness.generic.callback = UI_DisplayOptionsMenu_Event;
|
||||
displayOptionsInfo.brightness.generic.id = ID_BRIGHTNESS;
|
||||
displayOptionsInfo.brightness.generic.x = 400;
|
||||
displayOptionsInfo.brightness.generic.y = y;
|
||||
displayOptionsInfo.brightness.minvalue = 5;
|
||||
displayOptionsInfo.brightness.maxvalue = 20;
|
||||
if( !uis.glconfig.deviceSupportsGamma ) {
|
||||
displayOptionsInfo.brightness.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
|
||||
y += BIGCHAR_HEIGHT+2;
|
||||
displayOptionsInfo.screensize.generic.type = MTYPE_SLIDER;
|
||||
displayOptionsInfo.screensize.generic.name = "Screen Size:";
|
||||
displayOptionsInfo.screensize.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
displayOptionsInfo.screensize.generic.callback = UI_DisplayOptionsMenu_Event;
|
||||
displayOptionsInfo.screensize.generic.id = ID_SCREENSIZE;
|
||||
displayOptionsInfo.screensize.generic.x = 400;
|
||||
displayOptionsInfo.screensize.generic.y = y;
|
||||
displayOptionsInfo.screensize.minvalue = 3;
|
||||
displayOptionsInfo.screensize.maxvalue = 10;
|
||||
|
||||
displayOptionsInfo.back.generic.type = MTYPE_BITMAP;
|
||||
displayOptionsInfo.back.generic.name = ART_BACK0;
|
||||
displayOptionsInfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
displayOptionsInfo.back.generic.callback = UI_DisplayOptionsMenu_Event;
|
||||
displayOptionsInfo.back.generic.id = ID_BACK;
|
||||
displayOptionsInfo.back.generic.x = 0;
|
||||
displayOptionsInfo.back.generic.y = 480-64;
|
||||
displayOptionsInfo.back.width = 128;
|
||||
displayOptionsInfo.back.height = 64;
|
||||
displayOptionsInfo.back.focuspic = ART_BACK1;
|
||||
|
||||
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.banner );
|
||||
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.framel );
|
||||
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.framer );
|
||||
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.graphics );
|
||||
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.display );
|
||||
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.sound );
|
||||
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.network );
|
||||
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.brightness );
|
||||
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.screensize );
|
||||
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.back );
|
||||
|
||||
displayOptionsInfo.brightness.curvalue = trap_Cvar_VariableValue("r_gamma") * 10;
|
||||
displayOptionsInfo.screensize.curvalue = trap_Cvar_VariableValue( "cg_viewsize")/10;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_DisplayOptionsMenu_Cache
|
||||
===============
|
||||
*/
|
||||
void UI_DisplayOptionsMenu_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMEL );
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMER );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK0 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK1 );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_DisplayOptionsMenu
|
||||
===============
|
||||
*/
|
||||
void UI_DisplayOptionsMenu( void ) {
|
||||
UI_DisplayOptionsMenu_Init();
|
||||
UI_PushMenu( &displayOptionsInfo.menu );
|
||||
Menu_SetCursorToItem( &displayOptionsInfo.menu, &displayOptionsInfo.display );
|
||||
}
|
||||
800
code/q3_ui/.svn/text-base/ui_gameinfo.c.svn-base
Executable file
800
code/q3_ui/.svn/text-base/ui_gameinfo.c.svn-base
Executable file
@@ -0,0 +1,800 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
//
|
||||
// gameinfo.c
|
||||
//
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
//
|
||||
// arena and bot info
|
||||
//
|
||||
|
||||
#define POOLSIZE 128 * 1024
|
||||
|
||||
int ui_numBots;
|
||||
static char *ui_botInfos[MAX_BOTS];
|
||||
|
||||
static int ui_numArenas;
|
||||
static char *ui_arenaInfos[MAX_ARENAS];
|
||||
|
||||
static int ui_numSinglePlayerArenas;
|
||||
static int ui_numSpecialSinglePlayerArenas;
|
||||
|
||||
static char memoryPool[POOLSIZE];
|
||||
static int allocPoint, outOfMemory;
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_Alloc
|
||||
===============
|
||||
*/
|
||||
void *UI_Alloc( int size ) {
|
||||
char *p;
|
||||
|
||||
if ( allocPoint + size > POOLSIZE ) {
|
||||
outOfMemory = qtrue;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
p = &memoryPool[allocPoint];
|
||||
|
||||
allocPoint += ( size + 31 ) & ~31;
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_InitMemory
|
||||
===============
|
||||
*/
|
||||
void UI_InitMemory( void ) {
|
||||
allocPoint = 0;
|
||||
outOfMemory = qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_ParseInfos
|
||||
===============
|
||||
*/
|
||||
int UI_ParseInfos( char *buf, int max, char *infos[] ) {
|
||||
char *token;
|
||||
int count;
|
||||
char key[MAX_TOKEN_CHARS];
|
||||
char info[MAX_INFO_STRING];
|
||||
|
||||
count = 0;
|
||||
|
||||
while ( 1 ) {
|
||||
token = COM_Parse( &buf );
|
||||
if ( !token[0] ) {
|
||||
break;
|
||||
}
|
||||
if ( strcmp( token, "{" ) ) {
|
||||
Com_Printf( "Missing { in info file\n" );
|
||||
break;
|
||||
}
|
||||
|
||||
if ( count == max ) {
|
||||
Com_Printf( "Max infos exceeded\n" );
|
||||
break;
|
||||
}
|
||||
|
||||
info[0] = '\0';
|
||||
while ( 1 ) {
|
||||
token = COM_ParseExt( &buf, qtrue );
|
||||
if ( !token[0] ) {
|
||||
Com_Printf( "Unexpected end of info file\n" );
|
||||
break;
|
||||
}
|
||||
if ( !strcmp( token, "}" ) ) {
|
||||
break;
|
||||
}
|
||||
Q_strncpyz( key, token, sizeof( key ) );
|
||||
|
||||
token = COM_ParseExt( &buf, qfalse );
|
||||
if ( !token[0] ) {
|
||||
strcpy( token, "<NULL>" );
|
||||
}
|
||||
Info_SetValueForKey( info, key, token );
|
||||
}
|
||||
//NOTE: extra space for arena number
|
||||
infos[count] = UI_Alloc(strlen(info) + strlen("\\num\\") + strlen(va("%d", MAX_ARENAS)) + 1);
|
||||
if (infos[count]) {
|
||||
strcpy(infos[count], info);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_LoadArenasFromFile
|
||||
===============
|
||||
*/
|
||||
static void UI_LoadArenasFromFile( char *filename ) {
|
||||
int len;
|
||||
fileHandle_t f;
|
||||
char buf[MAX_ARENAS_TEXT];
|
||||
|
||||
len = trap_FS_FOpenFile( filename, &f, FS_READ );
|
||||
if ( !f ) {
|
||||
trap_Print( va( S_COLOR_RED "file not found: %s\n", filename ) );
|
||||
return;
|
||||
}
|
||||
if ( len >= MAX_ARENAS_TEXT ) {
|
||||
trap_Print( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i", filename, len, MAX_ARENAS_TEXT ) );
|
||||
trap_FS_FCloseFile( f );
|
||||
return;
|
||||
}
|
||||
|
||||
trap_FS_Read( buf, len, f );
|
||||
buf[len] = 0;
|
||||
trap_FS_FCloseFile( f );
|
||||
|
||||
ui_numArenas += UI_ParseInfos( buf, MAX_ARENAS - ui_numArenas, &ui_arenaInfos[ui_numArenas] );
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_LoadArenas
|
||||
===============
|
||||
*/
|
||||
static void UI_LoadArenas( void ) {
|
||||
int numdirs;
|
||||
vmCvar_t arenasFile;
|
||||
char filename[128];
|
||||
char dirlist[1024];
|
||||
char* dirptr;
|
||||
int i, n;
|
||||
int dirlen;
|
||||
char *type;
|
||||
char *tag;
|
||||
int singlePlayerNum, specialNum, otherNum;
|
||||
|
||||
ui_numArenas = 0;
|
||||
|
||||
trap_Cvar_Register( &arenasFile, "g_arenasFile", "", CVAR_INIT|CVAR_ROM );
|
||||
if( *arenasFile.string ) {
|
||||
UI_LoadArenasFromFile(arenasFile.string);
|
||||
}
|
||||
else {
|
||||
UI_LoadArenasFromFile("scripts/arenas.txt");
|
||||
}
|
||||
|
||||
// get all arenas from .arena files
|
||||
numdirs = trap_FS_GetFileList("scripts", ".arena", dirlist, 1024 );
|
||||
dirptr = dirlist;
|
||||
for (i = 0; i < numdirs; i++, dirptr += dirlen+1) {
|
||||
dirlen = strlen(dirptr);
|
||||
strcpy(filename, "scripts/");
|
||||
strcat(filename, dirptr);
|
||||
UI_LoadArenasFromFile(filename);
|
||||
}
|
||||
trap_Print( va( "%i arenas parsed\n", ui_numArenas ) );
|
||||
if (outOfMemory) trap_Print(S_COLOR_YELLOW"WARNING: not anough memory in pool to load all arenas\n");
|
||||
|
||||
// set initial numbers
|
||||
for( n = 0; n < ui_numArenas; n++ ) {
|
||||
Info_SetValueForKey( ui_arenaInfos[n], "num", va( "%i", n ) );
|
||||
}
|
||||
|
||||
// go through and count single players levels
|
||||
ui_numSinglePlayerArenas = 0;
|
||||
ui_numSpecialSinglePlayerArenas = 0;
|
||||
for( n = 0; n < ui_numArenas; n++ ) {
|
||||
// determine type
|
||||
type = Info_ValueForKey( ui_arenaInfos[n], "type" );
|
||||
|
||||
// if no type specified, it will be treated as "ffa"
|
||||
if( !*type ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if( strstr( type, "single" ) ) {
|
||||
// check for special single player arenas (training, final)
|
||||
tag = Info_ValueForKey( ui_arenaInfos[n], "special" );
|
||||
if( *tag ) {
|
||||
ui_numSpecialSinglePlayerArenas++;
|
||||
continue;
|
||||
}
|
||||
|
||||
ui_numSinglePlayerArenas++;
|
||||
}
|
||||
}
|
||||
|
||||
n = ui_numSinglePlayerArenas % ARENAS_PER_TIER;
|
||||
if( n != 0 ) {
|
||||
ui_numSinglePlayerArenas -= n;
|
||||
trap_Print( va( "%i arenas ignored to make count divisible by %i\n", n, ARENAS_PER_TIER ) );
|
||||
}
|
||||
|
||||
// go through once more and assign number to the levels
|
||||
singlePlayerNum = 0;
|
||||
specialNum = singlePlayerNum + ui_numSinglePlayerArenas;
|
||||
otherNum = specialNum + ui_numSpecialSinglePlayerArenas;
|
||||
for( n = 0; n < ui_numArenas; n++ ) {
|
||||
// determine type
|
||||
type = Info_ValueForKey( ui_arenaInfos[n], "type" );
|
||||
|
||||
// if no type specified, it will be treated as "ffa"
|
||||
if( *type ) {
|
||||
if( strstr( type, "single" ) ) {
|
||||
// check for special single player arenas (training, final)
|
||||
tag = Info_ValueForKey( ui_arenaInfos[n], "special" );
|
||||
if( *tag ) {
|
||||
Info_SetValueForKey( ui_arenaInfos[n], "num", va( "%i", specialNum++ ) );
|
||||
continue;
|
||||
}
|
||||
|
||||
Info_SetValueForKey( ui_arenaInfos[n], "num", va( "%i", singlePlayerNum++ ) );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Info_SetValueForKey( ui_arenaInfos[n], "num", va( "%i", otherNum++ ) );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_GetArenaInfoByNumber
|
||||
===============
|
||||
*/
|
||||
const char *UI_GetArenaInfoByNumber( int num ) {
|
||||
int n;
|
||||
char *value;
|
||||
|
||||
if( num < 0 || num >= ui_numArenas ) {
|
||||
trap_Print( va( S_COLOR_RED "Invalid arena number: %i\n", num ) );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for( n = 0; n < ui_numArenas; n++ ) {
|
||||
value = Info_ValueForKey( ui_arenaInfos[n], "num" );
|
||||
if( *value && atoi(value) == num ) {
|
||||
return ui_arenaInfos[n];
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_GetArenaInfoByNumber
|
||||
===============
|
||||
*/
|
||||
const char *UI_GetArenaInfoByMap( const char *map ) {
|
||||
int n;
|
||||
|
||||
for( n = 0; n < ui_numArenas; n++ ) {
|
||||
if( Q_stricmp( Info_ValueForKey( ui_arenaInfos[n], "map" ), map ) == 0 ) {
|
||||
return ui_arenaInfos[n];
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_GetSpecialArenaInfo
|
||||
===============
|
||||
*/
|
||||
const char *UI_GetSpecialArenaInfo( const char *tag ) {
|
||||
int n;
|
||||
|
||||
for( n = 0; n < ui_numArenas; n++ ) {
|
||||
if( Q_stricmp( Info_ValueForKey( ui_arenaInfos[n], "special" ), tag ) == 0 ) {
|
||||
return ui_arenaInfos[n];
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_LoadBotsFromFile
|
||||
===============
|
||||
*/
|
||||
static void UI_LoadBotsFromFile( char *filename ) {
|
||||
int len;
|
||||
fileHandle_t f;
|
||||
char buf[MAX_BOTS_TEXT];
|
||||
|
||||
len = trap_FS_FOpenFile( filename, &f, FS_READ );
|
||||
if ( !f ) {
|
||||
trap_Print( va( S_COLOR_RED "file not found: %s\n", filename ) );
|
||||
return;
|
||||
}
|
||||
if ( len >= MAX_BOTS_TEXT ) {
|
||||
trap_Print( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i", filename, len, MAX_BOTS_TEXT ) );
|
||||
trap_FS_FCloseFile( f );
|
||||
return;
|
||||
}
|
||||
|
||||
trap_FS_Read( buf, len, f );
|
||||
buf[len] = 0;
|
||||
trap_FS_FCloseFile( f );
|
||||
|
||||
ui_numBots += UI_ParseInfos( buf, MAX_BOTS - ui_numBots, &ui_botInfos[ui_numBots] );
|
||||
if (outOfMemory) trap_Print(S_COLOR_YELLOW"WARNING: not anough memory in pool to load all bots\n");
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_LoadBots
|
||||
===============
|
||||
*/
|
||||
static void UI_LoadBots( void ) {
|
||||
vmCvar_t botsFile;
|
||||
int numdirs;
|
||||
char filename[128];
|
||||
char dirlist[1024];
|
||||
char* dirptr;
|
||||
int i;
|
||||
int dirlen;
|
||||
|
||||
ui_numBots = 0;
|
||||
|
||||
trap_Cvar_Register( &botsFile, "g_botsFile", "", CVAR_INIT|CVAR_ROM );
|
||||
if( *botsFile.string ) {
|
||||
UI_LoadBotsFromFile(botsFile.string);
|
||||
}
|
||||
else {
|
||||
UI_LoadBotsFromFile("scripts/bots.txt");
|
||||
}
|
||||
|
||||
// get all bots from .bot files
|
||||
numdirs = trap_FS_GetFileList("scripts", ".bot", dirlist, 1024 );
|
||||
dirptr = dirlist;
|
||||
for (i = 0; i < numdirs; i++, dirptr += dirlen+1) {
|
||||
dirlen = strlen(dirptr);
|
||||
strcpy(filename, "scripts/");
|
||||
strcat(filename, dirptr);
|
||||
UI_LoadBotsFromFile(filename);
|
||||
}
|
||||
trap_Print( va( "%i bots parsed\n", ui_numBots ) );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_GetBotInfoByNumber
|
||||
===============
|
||||
*/
|
||||
char *UI_GetBotInfoByNumber( int num ) {
|
||||
if( num < 0 || num >= ui_numBots ) {
|
||||
trap_Print( va( S_COLOR_RED "Invalid bot number: %i\n", num ) );
|
||||
return NULL;
|
||||
}
|
||||
return ui_botInfos[num];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_GetBotInfoByName
|
||||
===============
|
||||
*/
|
||||
char *UI_GetBotInfoByName( const char *name ) {
|
||||
int n;
|
||||
char *value;
|
||||
|
||||
for ( n = 0; n < ui_numBots ; n++ ) {
|
||||
value = Info_ValueForKey( ui_botInfos[n], "name" );
|
||||
if ( !Q_stricmp( value, name ) ) {
|
||||
return ui_botInfos[n];
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// single player game info
|
||||
//
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_GetBestScore
|
||||
|
||||
Returns the player's best finish on a given level, 0 if the have not played the level
|
||||
===============
|
||||
*/
|
||||
void UI_GetBestScore( int level, int *score, int *skill ) {
|
||||
int n;
|
||||
int skillScore;
|
||||
int bestScore;
|
||||
int bestScoreSkill;
|
||||
char arenaKey[16];
|
||||
char scores[MAX_INFO_VALUE];
|
||||
|
||||
if( !score || !skill ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if( level < 0 || level > ui_numArenas ) {
|
||||
return;
|
||||
}
|
||||
|
||||
bestScore = 0;
|
||||
bestScoreSkill = 0;
|
||||
|
||||
for( n = 1; n <= 5; n++ ) {
|
||||
trap_Cvar_VariableStringBuffer( va( "g_spScores%i", n ), scores, MAX_INFO_VALUE );
|
||||
|
||||
Com_sprintf( arenaKey, sizeof( arenaKey ), "l%i", level );
|
||||
skillScore = atoi( Info_ValueForKey( scores, arenaKey ) );
|
||||
|
||||
if( skillScore < 1 || skillScore > 8 ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if( !bestScore || skillScore <= bestScore ) {
|
||||
bestScore = skillScore;
|
||||
bestScoreSkill = n;
|
||||
}
|
||||
}
|
||||
|
||||
*score = bestScore;
|
||||
*skill = bestScoreSkill;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_SetBestScore
|
||||
|
||||
Set the player's best finish for a level
|
||||
===============
|
||||
*/
|
||||
void UI_SetBestScore( int level, int score ) {
|
||||
int skill;
|
||||
int oldScore;
|
||||
char arenaKey[16];
|
||||
char scores[MAX_INFO_VALUE];
|
||||
|
||||
// validate score
|
||||
if( score < 1 || score > 8 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// validate skill
|
||||
skill = (int)trap_Cvar_VariableValue( "g_spSkill" );
|
||||
if( skill < 1 || skill > 5 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// get scores
|
||||
trap_Cvar_VariableStringBuffer( va( "g_spScores%i", skill ), scores, MAX_INFO_VALUE );
|
||||
|
||||
// see if this is better
|
||||
Com_sprintf( arenaKey, sizeof( arenaKey ), "l%i", level );
|
||||
oldScore = atoi( Info_ValueForKey( scores, arenaKey ) );
|
||||
if( oldScore && oldScore <= score ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// update scores
|
||||
Info_SetValueForKey( scores, arenaKey, va( "%i", score ) );
|
||||
trap_Cvar_Set( va( "g_spScores%i", skill ), scores );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_LogAwardData
|
||||
===============
|
||||
*/
|
||||
void UI_LogAwardData( int award, int data ) {
|
||||
char key[16];
|
||||
char awardData[MAX_INFO_VALUE];
|
||||
int oldValue;
|
||||
|
||||
if( data == 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if( award > AWARD_PERFECT ) {
|
||||
trap_Print( va( S_COLOR_RED "Bad award %i in UI_LogAwardData\n", award ) );
|
||||
return;
|
||||
}
|
||||
|
||||
trap_Cvar_VariableStringBuffer( "g_spAwards", awardData, sizeof(awardData) );
|
||||
|
||||
Com_sprintf( key, sizeof(key), "a%i", award );
|
||||
oldValue = atoi( Info_ValueForKey( awardData, key ) );
|
||||
|
||||
Info_SetValueForKey( awardData, key, va( "%i", oldValue + data ) );
|
||||
trap_Cvar_Set( "g_spAwards", awardData );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_GetAwardLevel
|
||||
===============
|
||||
*/
|
||||
int UI_GetAwardLevel( int award ) {
|
||||
char key[16];
|
||||
char awardData[MAX_INFO_VALUE];
|
||||
|
||||
trap_Cvar_VariableStringBuffer( "g_spAwards", awardData, sizeof(awardData) );
|
||||
|
||||
Com_sprintf( key, sizeof(key), "a%i", award );
|
||||
return atoi( Info_ValueForKey( awardData, key ) );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_TierCompleted
|
||||
===============
|
||||
*/
|
||||
int UI_TierCompleted( int levelWon ) {
|
||||
int level;
|
||||
int n;
|
||||
int tier;
|
||||
int score;
|
||||
int skill;
|
||||
const char *info;
|
||||
|
||||
tier = levelWon / ARENAS_PER_TIER;
|
||||
level = tier * ARENAS_PER_TIER;
|
||||
|
||||
if( tier == UI_GetNumSPTiers() ) {
|
||||
info = UI_GetSpecialArenaInfo( "training" );
|
||||
if( levelWon == atoi( Info_ValueForKey( info, "num" ) ) ) {
|
||||
return 0;
|
||||
}
|
||||
info = UI_GetSpecialArenaInfo( "final" );
|
||||
if( !info || levelWon == atoi( Info_ValueForKey( info, "num" ) ) ) {
|
||||
return tier + 1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
for( n = 0; n < ARENAS_PER_TIER; n++, level++ ) {
|
||||
UI_GetBestScore( level, &score, &skill );
|
||||
if ( score != 1 ) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return tier + 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_ShowTierVideo
|
||||
===============
|
||||
*/
|
||||
qboolean UI_ShowTierVideo( int tier ) {
|
||||
char key[16];
|
||||
char videos[MAX_INFO_VALUE];
|
||||
|
||||
if( tier <= 0 ) {
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
trap_Cvar_VariableStringBuffer( "g_spVideos", videos, sizeof(videos) );
|
||||
|
||||
Com_sprintf( key, sizeof(key), "tier%i", tier );
|
||||
if( atoi( Info_ValueForKey( videos, key ) ) ) {
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
Info_SetValueForKey( videos, key, va( "%i", 1 ) );
|
||||
trap_Cvar_Set( "g_spVideos", videos );
|
||||
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_CanShowTierVideo
|
||||
===============
|
||||
*/
|
||||
qboolean UI_CanShowTierVideo( int tier ) {
|
||||
char key[16];
|
||||
char videos[MAX_INFO_VALUE];
|
||||
|
||||
if( !tier ) {
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
if( uis.demoversion && tier != 8 ) {
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
trap_Cvar_VariableStringBuffer( "g_spVideos", videos, sizeof(videos) );
|
||||
|
||||
Com_sprintf( key, sizeof(key), "tier%i", tier );
|
||||
if( atoi( Info_ValueForKey( videos, key ) ) ) {
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_GetCurrentGame
|
||||
|
||||
Returns the next level the player has not won
|
||||
===============
|
||||
*/
|
||||
int UI_GetCurrentGame( void ) {
|
||||
int level;
|
||||
int rank;
|
||||
int skill;
|
||||
const char *info;
|
||||
|
||||
info = UI_GetSpecialArenaInfo( "training" );
|
||||
if( info ) {
|
||||
level = atoi( Info_ValueForKey( info, "num" ) );
|
||||
UI_GetBestScore( level, &rank, &skill );
|
||||
if ( !rank || rank > 1 ) {
|
||||
return level;
|
||||
}
|
||||
}
|
||||
|
||||
for( level = 0; level < ui_numSinglePlayerArenas; level++ ) {
|
||||
UI_GetBestScore( level, &rank, &skill );
|
||||
if ( !rank || rank > 1 ) {
|
||||
return level;
|
||||
}
|
||||
}
|
||||
|
||||
info = UI_GetSpecialArenaInfo( "final" );
|
||||
if( !info ) {
|
||||
return -1;
|
||||
}
|
||||
return atoi( Info_ValueForKey( info, "num" ) );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_NewGame
|
||||
|
||||
Clears the scores and sets the difficutly level
|
||||
===============
|
||||
*/
|
||||
void UI_NewGame( void ) {
|
||||
trap_Cvar_Set( "g_spScores1", "" );
|
||||
trap_Cvar_Set( "g_spScores2", "" );
|
||||
trap_Cvar_Set( "g_spScores3", "" );
|
||||
trap_Cvar_Set( "g_spScores4", "" );
|
||||
trap_Cvar_Set( "g_spScores5", "" );
|
||||
trap_Cvar_Set( "g_spAwards", "" );
|
||||
trap_Cvar_Set( "g_spVideos", "" );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_GetNumArenas
|
||||
===============
|
||||
*/
|
||||
int UI_GetNumArenas( void ) {
|
||||
return ui_numArenas;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_GetNumSPArenas
|
||||
===============
|
||||
*/
|
||||
int UI_GetNumSPArenas( void ) {
|
||||
return ui_numSinglePlayerArenas;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_GetNumSPTiers
|
||||
===============
|
||||
*/
|
||||
int UI_GetNumSPTiers( void ) {
|
||||
return ui_numSinglePlayerArenas / ARENAS_PER_TIER;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_GetNumBots
|
||||
===============
|
||||
*/
|
||||
int UI_GetNumBots( void ) {
|
||||
return ui_numBots;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_SPUnlock_f
|
||||
===============
|
||||
*/
|
||||
void UI_SPUnlock_f( void ) {
|
||||
char arenaKey[16];
|
||||
char scores[MAX_INFO_VALUE];
|
||||
int level;
|
||||
int tier;
|
||||
|
||||
// get scores for skill 1
|
||||
trap_Cvar_VariableStringBuffer( "g_spScores1", scores, MAX_INFO_VALUE );
|
||||
|
||||
// update scores
|
||||
for( level = 0; level < ui_numSinglePlayerArenas + ui_numSpecialSinglePlayerArenas; level++ ) {
|
||||
Com_sprintf( arenaKey, sizeof( arenaKey ), "l%i", level );
|
||||
Info_SetValueForKey( scores, arenaKey, "1" );
|
||||
}
|
||||
trap_Cvar_Set( "g_spScores1", scores );
|
||||
|
||||
// unlock cinematics
|
||||
for( tier = 1; tier <= 8; tier++ ) {
|
||||
UI_ShowTierVideo( tier );
|
||||
}
|
||||
|
||||
trap_Print( "All levels unlocked at skill level 1\n" );
|
||||
|
||||
UI_SPLevelMenu_ReInit();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_SPUnlockMedals_f
|
||||
===============
|
||||
*/
|
||||
void UI_SPUnlockMedals_f( void ) {
|
||||
int n;
|
||||
char key[16];
|
||||
char awardData[MAX_INFO_VALUE];
|
||||
|
||||
trap_Cvar_VariableStringBuffer( "g_spAwards", awardData, MAX_INFO_VALUE );
|
||||
|
||||
for( n = 0; n < 6; n++ ) {
|
||||
Com_sprintf( key, sizeof(key), "a%i", n );
|
||||
Info_SetValueForKey( awardData, key, "100" );
|
||||
}
|
||||
|
||||
trap_Cvar_Set( "g_spAwards", awardData );
|
||||
|
||||
trap_Print( "All levels unlocked at 100\n" );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_InitGameinfo
|
||||
===============
|
||||
*/
|
||||
void UI_InitGameinfo( void ) {
|
||||
|
||||
UI_InitMemory();
|
||||
UI_LoadArenas();
|
||||
UI_LoadBots();
|
||||
|
||||
if( (trap_Cvar_VariableValue( "fs_restrict" )) || (ui_numSpecialSinglePlayerArenas == 0 && ui_numSinglePlayerArenas == 4) ) {
|
||||
uis.demoversion = qtrue;
|
||||
}
|
||||
else {
|
||||
uis.demoversion = qfalse;
|
||||
}
|
||||
}
|
||||
329
code/q3_ui/.svn/text-base/ui_ingame.c.svn-base
Executable file
329
code/q3_ui/.svn/text-base/ui_ingame.c.svn-base
Executable file
@@ -0,0 +1,329 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
/*
|
||||
=======================================================================
|
||||
|
||||
INGAME MENU
|
||||
|
||||
=======================================================================
|
||||
*/
|
||||
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define INGAME_FRAME "menu/art/addbotframe"
|
||||
//#define INGAME_FRAME "menu/art/cut_frame"
|
||||
#define INGAME_MENU_VERTICAL_SPACING 28
|
||||
|
||||
#define ID_TEAM 10
|
||||
#define ID_ADDBOTS 11
|
||||
#define ID_REMOVEBOTS 12
|
||||
#define ID_SETUP 13
|
||||
#define ID_SERVERINFO 14
|
||||
#define ID_LEAVEARENA 15
|
||||
#define ID_RESTART 16
|
||||
#define ID_QUIT 17
|
||||
#define ID_RESUME 18
|
||||
#define ID_TEAMORDERS 19
|
||||
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
|
||||
menubitmap_s frame;
|
||||
menutext_s team;
|
||||
menutext_s setup;
|
||||
menutext_s server;
|
||||
menutext_s leave;
|
||||
menutext_s restart;
|
||||
menutext_s addbots;
|
||||
menutext_s removebots;
|
||||
menutext_s teamorders;
|
||||
menutext_s quit;
|
||||
menutext_s resume;
|
||||
} ingamemenu_t;
|
||||
|
||||
static ingamemenu_t s_ingame;
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
InGame_RestartAction
|
||||
=================
|
||||
*/
|
||||
static void InGame_RestartAction( qboolean result ) {
|
||||
if( !result ) {
|
||||
return;
|
||||
}
|
||||
|
||||
UI_PopMenu();
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, "map_restart 0\n" );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
InGame_QuitAction
|
||||
=================
|
||||
*/
|
||||
static void InGame_QuitAction( qboolean result ) {
|
||||
if( !result ) {
|
||||
return;
|
||||
}
|
||||
UI_PopMenu();
|
||||
UI_CreditMenu();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
InGame_Event
|
||||
=================
|
||||
*/
|
||||
void InGame_Event( void *ptr, int notification ) {
|
||||
if( notification != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch( ((menucommon_s*)ptr)->id ) {
|
||||
case ID_TEAM:
|
||||
UI_TeamMainMenu();
|
||||
break;
|
||||
|
||||
case ID_SETUP:
|
||||
UI_SetupMenu();
|
||||
break;
|
||||
|
||||
case ID_LEAVEARENA:
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, "disconnect\n" );
|
||||
break;
|
||||
|
||||
case ID_RESTART:
|
||||
UI_ConfirmMenu( "RESTART ARENA?", (voidfunc_f)NULL, InGame_RestartAction );
|
||||
break;
|
||||
|
||||
case ID_QUIT:
|
||||
UI_ConfirmMenu( "EXIT GAME?", (voidfunc_f)NULL, InGame_QuitAction );
|
||||
break;
|
||||
|
||||
case ID_SERVERINFO:
|
||||
UI_ServerInfoMenu();
|
||||
break;
|
||||
|
||||
case ID_ADDBOTS:
|
||||
UI_AddBotsMenu();
|
||||
break;
|
||||
|
||||
case ID_REMOVEBOTS:
|
||||
UI_RemoveBotsMenu();
|
||||
break;
|
||||
|
||||
case ID_TEAMORDERS:
|
||||
UI_TeamOrdersMenu();
|
||||
break;
|
||||
|
||||
case ID_RESUME:
|
||||
UI_PopMenu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
InGame_MenuInit
|
||||
=================
|
||||
*/
|
||||
void InGame_MenuInit( void ) {
|
||||
int y;
|
||||
uiClientState_t cs;
|
||||
char info[MAX_INFO_STRING];
|
||||
int team;
|
||||
|
||||
memset( &s_ingame, 0 ,sizeof(ingamemenu_t) );
|
||||
|
||||
InGame_Cache();
|
||||
|
||||
s_ingame.menu.wrapAround = qtrue;
|
||||
s_ingame.menu.fullscreen = qfalse;
|
||||
|
||||
s_ingame.frame.generic.type = MTYPE_BITMAP;
|
||||
s_ingame.frame.generic.flags = QMF_INACTIVE;
|
||||
s_ingame.frame.generic.name = INGAME_FRAME;
|
||||
s_ingame.frame.generic.x = 320-233;//142;
|
||||
s_ingame.frame.generic.y = 240-166;//118;
|
||||
s_ingame.frame.width = 466;//359;
|
||||
s_ingame.frame.height = 332;//256;
|
||||
|
||||
//y = 96;
|
||||
y = 88;
|
||||
s_ingame.team.generic.type = MTYPE_PTEXT;
|
||||
s_ingame.team.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_ingame.team.generic.x = 320;
|
||||
s_ingame.team.generic.y = y;
|
||||
s_ingame.team.generic.id = ID_TEAM;
|
||||
s_ingame.team.generic.callback = InGame_Event;
|
||||
s_ingame.team.string = "START";
|
||||
s_ingame.team.color = color_red;
|
||||
s_ingame.team.style = UI_CENTER|UI_SMALLFONT;
|
||||
|
||||
y += INGAME_MENU_VERTICAL_SPACING;
|
||||
s_ingame.addbots.generic.type = MTYPE_PTEXT;
|
||||
s_ingame.addbots.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_ingame.addbots.generic.x = 320;
|
||||
s_ingame.addbots.generic.y = y;
|
||||
s_ingame.addbots.generic.id = ID_ADDBOTS;
|
||||
s_ingame.addbots.generic.callback = InGame_Event;
|
||||
s_ingame.addbots.string = "ADD BOTS";
|
||||
s_ingame.addbots.color = color_red;
|
||||
s_ingame.addbots.style = UI_CENTER|UI_SMALLFONT;
|
||||
if( !trap_Cvar_VariableValue( "sv_running" ) || !trap_Cvar_VariableValue( "bot_enable" ) || (trap_Cvar_VariableValue( "g_gametype" ) == GT_SINGLE_PLAYER)) {
|
||||
s_ingame.addbots.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
|
||||
y += INGAME_MENU_VERTICAL_SPACING;
|
||||
s_ingame.removebots.generic.type = MTYPE_PTEXT;
|
||||
s_ingame.removebots.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_ingame.removebots.generic.x = 320;
|
||||
s_ingame.removebots.generic.y = y;
|
||||
s_ingame.removebots.generic.id = ID_REMOVEBOTS;
|
||||
s_ingame.removebots.generic.callback = InGame_Event;
|
||||
s_ingame.removebots.string = "REMOVE BOTS";
|
||||
s_ingame.removebots.color = color_red;
|
||||
s_ingame.removebots.style = UI_CENTER|UI_SMALLFONT;
|
||||
if( !trap_Cvar_VariableValue( "sv_running" ) || !trap_Cvar_VariableValue( "bot_enable" ) || (trap_Cvar_VariableValue( "g_gametype" ) == GT_SINGLE_PLAYER)) {
|
||||
s_ingame.removebots.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
|
||||
y += INGAME_MENU_VERTICAL_SPACING;
|
||||
s_ingame.teamorders.generic.type = MTYPE_PTEXT;
|
||||
s_ingame.teamorders.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_ingame.teamorders.generic.x = 320;
|
||||
s_ingame.teamorders.generic.y = y;
|
||||
s_ingame.teamorders.generic.id = ID_TEAMORDERS;
|
||||
s_ingame.teamorders.generic.callback = InGame_Event;
|
||||
s_ingame.teamorders.string = "TEAM ORDERS";
|
||||
s_ingame.teamorders.color = color_red;
|
||||
s_ingame.teamorders.style = UI_CENTER|UI_SMALLFONT;
|
||||
if( !(trap_Cvar_VariableValue( "g_gametype" ) >= GT_TEAM) ) {
|
||||
s_ingame.teamorders.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
else {
|
||||
trap_GetClientState( &cs );
|
||||
trap_GetConfigString( CS_PLAYERS + cs.clientNum, info, MAX_INFO_STRING );
|
||||
team = atoi( Info_ValueForKey( info, "t" ) );
|
||||
if( team == TEAM_SPECTATOR ) {
|
||||
s_ingame.teamorders.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
}
|
||||
|
||||
y += INGAME_MENU_VERTICAL_SPACING;
|
||||
s_ingame.setup.generic.type = MTYPE_PTEXT;
|
||||
s_ingame.setup.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_ingame.setup.generic.x = 320;
|
||||
s_ingame.setup.generic.y = y;
|
||||
s_ingame.setup.generic.id = ID_SETUP;
|
||||
s_ingame.setup.generic.callback = InGame_Event;
|
||||
s_ingame.setup.string = "SETUP";
|
||||
s_ingame.setup.color = color_red;
|
||||
s_ingame.setup.style = UI_CENTER|UI_SMALLFONT;
|
||||
|
||||
y += INGAME_MENU_VERTICAL_SPACING;
|
||||
s_ingame.server.generic.type = MTYPE_PTEXT;
|
||||
s_ingame.server.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_ingame.server.generic.x = 320;
|
||||
s_ingame.server.generic.y = y;
|
||||
s_ingame.server.generic.id = ID_SERVERINFO;
|
||||
s_ingame.server.generic.callback = InGame_Event;
|
||||
s_ingame.server.string = "SERVER INFO";
|
||||
s_ingame.server.color = color_red;
|
||||
s_ingame.server.style = UI_CENTER|UI_SMALLFONT;
|
||||
|
||||
y += INGAME_MENU_VERTICAL_SPACING;
|
||||
s_ingame.restart.generic.type = MTYPE_PTEXT;
|
||||
s_ingame.restart.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_ingame.restart.generic.x = 320;
|
||||
s_ingame.restart.generic.y = y;
|
||||
s_ingame.restart.generic.id = ID_RESTART;
|
||||
s_ingame.restart.generic.callback = InGame_Event;
|
||||
s_ingame.restart.string = "RESTART ARENA";
|
||||
s_ingame.restart.color = color_red;
|
||||
s_ingame.restart.style = UI_CENTER|UI_SMALLFONT;
|
||||
if( !trap_Cvar_VariableValue( "sv_running" ) ) {
|
||||
s_ingame.restart.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
|
||||
y += INGAME_MENU_VERTICAL_SPACING;
|
||||
s_ingame.resume.generic.type = MTYPE_PTEXT;
|
||||
s_ingame.resume.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_ingame.resume.generic.x = 320;
|
||||
s_ingame.resume.generic.y = y;
|
||||
s_ingame.resume.generic.id = ID_RESUME;
|
||||
s_ingame.resume.generic.callback = InGame_Event;
|
||||
s_ingame.resume.string = "RESUME GAME";
|
||||
s_ingame.resume.color = color_red;
|
||||
s_ingame.resume.style = UI_CENTER|UI_SMALLFONT;
|
||||
|
||||
y += INGAME_MENU_VERTICAL_SPACING;
|
||||
s_ingame.leave.generic.type = MTYPE_PTEXT;
|
||||
s_ingame.leave.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_ingame.leave.generic.x = 320;
|
||||
s_ingame.leave.generic.y = y;
|
||||
s_ingame.leave.generic.id = ID_LEAVEARENA;
|
||||
s_ingame.leave.generic.callback = InGame_Event;
|
||||
s_ingame.leave.string = "LEAVE ARENA";
|
||||
s_ingame.leave.color = color_red;
|
||||
s_ingame.leave.style = UI_CENTER|UI_SMALLFONT;
|
||||
|
||||
y += INGAME_MENU_VERTICAL_SPACING;
|
||||
s_ingame.quit.generic.type = MTYPE_PTEXT;
|
||||
s_ingame.quit.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_ingame.quit.generic.x = 320;
|
||||
s_ingame.quit.generic.y = y;
|
||||
s_ingame.quit.generic.id = ID_QUIT;
|
||||
s_ingame.quit.generic.callback = InGame_Event;
|
||||
s_ingame.quit.string = "EXIT GAME";
|
||||
s_ingame.quit.color = color_red;
|
||||
s_ingame.quit.style = UI_CENTER|UI_SMALLFONT;
|
||||
|
||||
Menu_AddItem( &s_ingame.menu, &s_ingame.frame );
|
||||
Menu_AddItem( &s_ingame.menu, &s_ingame.team );
|
||||
Menu_AddItem( &s_ingame.menu, &s_ingame.addbots );
|
||||
Menu_AddItem( &s_ingame.menu, &s_ingame.removebots );
|
||||
Menu_AddItem( &s_ingame.menu, &s_ingame.teamorders );
|
||||
Menu_AddItem( &s_ingame.menu, &s_ingame.setup );
|
||||
Menu_AddItem( &s_ingame.menu, &s_ingame.server );
|
||||
Menu_AddItem( &s_ingame.menu, &s_ingame.restart );
|
||||
Menu_AddItem( &s_ingame.menu, &s_ingame.resume );
|
||||
Menu_AddItem( &s_ingame.menu, &s_ingame.leave );
|
||||
Menu_AddItem( &s_ingame.menu, &s_ingame.quit );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
InGame_Cache
|
||||
=================
|
||||
*/
|
||||
void InGame_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( INGAME_FRAME );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_InGameMenu
|
||||
=================
|
||||
*/
|
||||
void UI_InGameMenu( void ) {
|
||||
// force as top level menu
|
||||
uis.menusp = 0;
|
||||
|
||||
// set menu cursor to a nice location
|
||||
uis.cursorx = 319;
|
||||
uis.cursory = 80;
|
||||
|
||||
InGame_MenuInit();
|
||||
UI_PushMenu( &s_ingame.menu );
|
||||
}
|
||||
254
code/q3_ui/.svn/text-base/ui_loadconfig.c.svn-base
Executable file
254
code/q3_ui/.svn/text-base/ui_loadconfig.c.svn-base
Executable file
@@ -0,0 +1,254 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
LOAD CONFIG MENU
|
||||
|
||||
=============================================================================
|
||||
*/
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define ART_BACK0 "menu/art/back_0"
|
||||
#define ART_BACK1 "menu/art/back_1"
|
||||
#define ART_FIGHT0 "menu/art/load_0"
|
||||
#define ART_FIGHT1 "menu/art/load_1"
|
||||
#define ART_FRAMEL "menu/art/frame2_l"
|
||||
#define ART_FRAMER "menu/art/frame1_r"
|
||||
#define ART_ARROWS "menu/art/arrows_horz_0"
|
||||
#define ART_ARROWLEFT "menu/art/arrows_horz_left"
|
||||
#define ART_ARROWRIGHT "menu/art/arrows_horz_right"
|
||||
|
||||
#define MAX_CONFIGS 128
|
||||
#define NAMEBUFSIZE ( MAX_CONFIGS * 16 )
|
||||
|
||||
#define ID_BACK 10
|
||||
#define ID_GO 11
|
||||
#define ID_LIST 12
|
||||
#define ID_LEFT 13
|
||||
#define ID_RIGHT 14
|
||||
|
||||
#define ARROWS_WIDTH 128
|
||||
#define ARROWS_HEIGHT 48
|
||||
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
|
||||
menutext_s banner;
|
||||
menubitmap_s framel;
|
||||
menubitmap_s framer;
|
||||
|
||||
menulist_s list;
|
||||
|
||||
menubitmap_s arrows;
|
||||
menubitmap_s left;
|
||||
menubitmap_s right;
|
||||
menubitmap_s back;
|
||||
menubitmap_s go;
|
||||
|
||||
char names[NAMEBUFSIZE];
|
||||
char* configlist[MAX_CONFIGS];
|
||||
} configs_t;
|
||||
|
||||
static configs_t s_configs;
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
LoadConfig_MenuEvent
|
||||
===============
|
||||
*/
|
||||
static void LoadConfig_MenuEvent( void *ptr, int event ) {
|
||||
if( event != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch ( ((menucommon_s*)ptr)->id ) {
|
||||
case ID_GO:
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va( "exec %s\n", s_configs.list.itemnames[s_configs.list.curvalue] ) );
|
||||
UI_PopMenu();
|
||||
break;
|
||||
|
||||
case ID_BACK:
|
||||
UI_PopMenu();
|
||||
break;
|
||||
|
||||
case ID_LEFT:
|
||||
ScrollList_Key( &s_configs.list, K_LEFTARROW );
|
||||
break;
|
||||
|
||||
case ID_RIGHT:
|
||||
ScrollList_Key( &s_configs.list, K_RIGHTARROW );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
LoadConfig_MenuInit
|
||||
===============
|
||||
*/
|
||||
static void LoadConfig_MenuInit( void ) {
|
||||
int i;
|
||||
int len;
|
||||
char *configname;
|
||||
|
||||
UI_LoadConfig_Cache();
|
||||
|
||||
memset( &s_configs, 0 ,sizeof(configs_t) );
|
||||
s_configs.menu.wrapAround = qtrue;
|
||||
s_configs.menu.fullscreen = qtrue;
|
||||
|
||||
s_configs.banner.generic.type = MTYPE_BTEXT;
|
||||
s_configs.banner.generic.x = 320;
|
||||
s_configs.banner.generic.y = 16;
|
||||
s_configs.banner.string = "LOAD CONFIG";
|
||||
s_configs.banner.color = color_white;
|
||||
s_configs.banner.style = UI_CENTER;
|
||||
|
||||
s_configs.framel.generic.type = MTYPE_BITMAP;
|
||||
s_configs.framel.generic.name = ART_FRAMEL;
|
||||
s_configs.framel.generic.flags = QMF_INACTIVE;
|
||||
s_configs.framel.generic.x = 0;
|
||||
s_configs.framel.generic.y = 78;
|
||||
s_configs.framel.width = 256;
|
||||
s_configs.framel.height = 329;
|
||||
|
||||
s_configs.framer.generic.type = MTYPE_BITMAP;
|
||||
s_configs.framer.generic.name = ART_FRAMER;
|
||||
s_configs.framer.generic.flags = QMF_INACTIVE;
|
||||
s_configs.framer.generic.x = 376;
|
||||
s_configs.framer.generic.y = 76;
|
||||
s_configs.framer.width = 256;
|
||||
s_configs.framer.height = 334;
|
||||
|
||||
s_configs.arrows.generic.type = MTYPE_BITMAP;
|
||||
s_configs.arrows.generic.name = ART_ARROWS;
|
||||
s_configs.arrows.generic.flags = QMF_INACTIVE;
|
||||
s_configs.arrows.generic.x = 320-ARROWS_WIDTH/2;
|
||||
s_configs.arrows.generic.y = 400;
|
||||
s_configs.arrows.width = ARROWS_WIDTH;
|
||||
s_configs.arrows.height = ARROWS_HEIGHT;
|
||||
|
||||
s_configs.left.generic.type = MTYPE_BITMAP;
|
||||
s_configs.left.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_MOUSEONLY;
|
||||
s_configs.left.generic.x = 320-ARROWS_WIDTH/2;
|
||||
s_configs.left.generic.y = 400;
|
||||
s_configs.left.generic.id = ID_LEFT;
|
||||
s_configs.left.generic.callback = LoadConfig_MenuEvent;
|
||||
s_configs.left.width = ARROWS_WIDTH/2;
|
||||
s_configs.left.height = ARROWS_HEIGHT;
|
||||
s_configs.left.focuspic = ART_ARROWLEFT;
|
||||
|
||||
s_configs.right.generic.type = MTYPE_BITMAP;
|
||||
s_configs.right.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_MOUSEONLY;
|
||||
s_configs.right.generic.x = 320;
|
||||
s_configs.right.generic.y = 400;
|
||||
s_configs.right.generic.id = ID_RIGHT;
|
||||
s_configs.right.generic.callback = LoadConfig_MenuEvent;
|
||||
s_configs.right.width = ARROWS_WIDTH/2;
|
||||
s_configs.right.height = ARROWS_HEIGHT;
|
||||
s_configs.right.focuspic = ART_ARROWRIGHT;
|
||||
|
||||
s_configs.back.generic.type = MTYPE_BITMAP;
|
||||
s_configs.back.generic.name = ART_BACK0;
|
||||
s_configs.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_configs.back.generic.id = ID_BACK;
|
||||
s_configs.back.generic.callback = LoadConfig_MenuEvent;
|
||||
s_configs.back.generic.x = 0;
|
||||
s_configs.back.generic.y = 480-64;
|
||||
s_configs.back.width = 128;
|
||||
s_configs.back.height = 64;
|
||||
s_configs.back.focuspic = ART_BACK1;
|
||||
|
||||
s_configs.go.generic.type = MTYPE_BITMAP;
|
||||
s_configs.go.generic.name = ART_FIGHT0;
|
||||
s_configs.go.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_configs.go.generic.id = ID_GO;
|
||||
s_configs.go.generic.callback = LoadConfig_MenuEvent;
|
||||
s_configs.go.generic.x = 640;
|
||||
s_configs.go.generic.y = 480-64;
|
||||
s_configs.go.width = 128;
|
||||
s_configs.go.height = 64;
|
||||
s_configs.go.focuspic = ART_FIGHT1;
|
||||
|
||||
// scan for configs
|
||||
s_configs.list.generic.type = MTYPE_SCROLLLIST;
|
||||
s_configs.list.generic.flags = QMF_PULSEIFFOCUS;
|
||||
s_configs.list.generic.callback = LoadConfig_MenuEvent;
|
||||
s_configs.list.generic.id = ID_LIST;
|
||||
s_configs.list.generic.x = 118;
|
||||
s_configs.list.generic.y = 130;
|
||||
s_configs.list.width = 16;
|
||||
s_configs.list.height = 14;
|
||||
s_configs.list.numitems = trap_FS_GetFileList( "", "cfg", s_configs.names, NAMEBUFSIZE );
|
||||
s_configs.list.itemnames = (const char **)s_configs.configlist;
|
||||
s_configs.list.columns = 3;
|
||||
|
||||
if (!s_configs.list.numitems) {
|
||||
strcpy(s_configs.names,"No Files Found.");
|
||||
s_configs.list.numitems = 1;
|
||||
|
||||
//degenerate case, not selectable
|
||||
s_configs.go.generic.flags |= (QMF_INACTIVE|QMF_HIDDEN);
|
||||
}
|
||||
else if (s_configs.list.numitems > MAX_CONFIGS)
|
||||
s_configs.list.numitems = MAX_CONFIGS;
|
||||
|
||||
configname = s_configs.names;
|
||||
for ( i = 0; i < s_configs.list.numitems; i++ ) {
|
||||
s_configs.list.itemnames[i] = configname;
|
||||
|
||||
// strip extension
|
||||
len = strlen( configname );
|
||||
if (!Q_stricmp(configname + len - 4,".cfg"))
|
||||
configname[len-4] = '\0';
|
||||
|
||||
Q_strupr(configname);
|
||||
|
||||
configname += len + 1;
|
||||
}
|
||||
|
||||
Menu_AddItem( &s_configs.menu, &s_configs.banner );
|
||||
Menu_AddItem( &s_configs.menu, &s_configs.framel );
|
||||
Menu_AddItem( &s_configs.menu, &s_configs.framer );
|
||||
Menu_AddItem( &s_configs.menu, &s_configs.list );
|
||||
Menu_AddItem( &s_configs.menu, &s_configs.arrows );
|
||||
Menu_AddItem( &s_configs.menu, &s_configs.left );
|
||||
Menu_AddItem( &s_configs.menu, &s_configs.right );
|
||||
Menu_AddItem( &s_configs.menu, &s_configs.back );
|
||||
Menu_AddItem( &s_configs.menu, &s_configs.go );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_LoadConfig_Cache
|
||||
=================
|
||||
*/
|
||||
void UI_LoadConfig_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( ART_BACK0 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK1 );
|
||||
trap_R_RegisterShaderNoMip( ART_FIGHT0 );
|
||||
trap_R_RegisterShaderNoMip( ART_FIGHT1 );
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMEL );
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMER );
|
||||
trap_R_RegisterShaderNoMip( ART_ARROWS );
|
||||
trap_R_RegisterShaderNoMip( ART_ARROWLEFT );
|
||||
trap_R_RegisterShaderNoMip( ART_ARROWRIGHT );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_LoadConfigMenu
|
||||
===============
|
||||
*/
|
||||
void UI_LoadConfigMenu( void ) {
|
||||
LoadConfig_MenuInit();
|
||||
UI_PushMenu( &s_configs.menu );
|
||||
}
|
||||
|
||||
780
code/q3_ui/.svn/text-base/ui_local.h.svn-base
Executable file
780
code/q3_ui/.svn/text-base/ui_local.h.svn-base
Executable file
@@ -0,0 +1,780 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
#ifndef __UI_LOCAL_H__
|
||||
#define __UI_LOCAL_H__
|
||||
|
||||
#include "../game/q_shared.h"
|
||||
#include "../cgame/tr_types.h"
|
||||
//NOTE: include the ui_public.h from the new UI
|
||||
#include "../ui/ui_public.h" // bk001205 - yes, do have to use this
|
||||
//redefine to old API version
|
||||
#undef UI_API_VERSION
|
||||
#define UI_API_VERSION 4
|
||||
#include "keycodes.h"
|
||||
#include "../game/bg_public.h"
|
||||
|
||||
typedef void (*voidfunc_f)(void);
|
||||
|
||||
extern vmCvar_t ui_ffa_fraglimit;
|
||||
extern vmCvar_t ui_ffa_timelimit;
|
||||
|
||||
extern vmCvar_t ui_tourney_fraglimit;
|
||||
extern vmCvar_t ui_tourney_timelimit;
|
||||
|
||||
extern vmCvar_t ui_team_fraglimit;
|
||||
extern vmCvar_t ui_team_timelimit;
|
||||
extern vmCvar_t ui_team_friendly;
|
||||
|
||||
extern vmCvar_t ui_ctf_capturelimit;
|
||||
extern vmCvar_t ui_ctf_timelimit;
|
||||
extern vmCvar_t ui_ctf_friendly;
|
||||
|
||||
extern vmCvar_t ui_arenasFile;
|
||||
extern vmCvar_t ui_botsFile;
|
||||
extern vmCvar_t ui_spScores1;
|
||||
extern vmCvar_t ui_spScores2;
|
||||
extern vmCvar_t ui_spScores3;
|
||||
extern vmCvar_t ui_spScores4;
|
||||
extern vmCvar_t ui_spScores5;
|
||||
extern vmCvar_t ui_spAwards;
|
||||
extern vmCvar_t ui_spVideos;
|
||||
extern vmCvar_t ui_spSkill;
|
||||
|
||||
extern vmCvar_t ui_spSelection;
|
||||
|
||||
extern vmCvar_t ui_browserMaster;
|
||||
extern vmCvar_t ui_browserGameType;
|
||||
extern vmCvar_t ui_browserSortKey;
|
||||
extern vmCvar_t ui_browserShowFull;
|
||||
extern vmCvar_t ui_browserShowEmpty;
|
||||
|
||||
extern vmCvar_t ui_brassTime;
|
||||
extern vmCvar_t ui_drawCrosshair;
|
||||
extern vmCvar_t ui_drawCrosshairNames;
|
||||
extern vmCvar_t ui_marks;
|
||||
|
||||
extern vmCvar_t ui_server1;
|
||||
extern vmCvar_t ui_server2;
|
||||
extern vmCvar_t ui_server3;
|
||||
extern vmCvar_t ui_server4;
|
||||
extern vmCvar_t ui_server5;
|
||||
extern vmCvar_t ui_server6;
|
||||
extern vmCvar_t ui_server7;
|
||||
extern vmCvar_t ui_server8;
|
||||
extern vmCvar_t ui_server9;
|
||||
extern vmCvar_t ui_server10;
|
||||
extern vmCvar_t ui_server11;
|
||||
extern vmCvar_t ui_server12;
|
||||
extern vmCvar_t ui_server13;
|
||||
extern vmCvar_t ui_server14;
|
||||
extern vmCvar_t ui_server15;
|
||||
extern vmCvar_t ui_server16;
|
||||
|
||||
extern vmCvar_t ui_cdkey;
|
||||
extern vmCvar_t ui_cdkeychecked;
|
||||
|
||||
|
||||
//
|
||||
// ui_qmenu.c
|
||||
//
|
||||
|
||||
#define RCOLUMN_OFFSET ( BIGCHAR_WIDTH )
|
||||
#define LCOLUMN_OFFSET (-BIGCHAR_WIDTH )
|
||||
|
||||
#define SLIDER_RANGE 10
|
||||
#define MAX_EDIT_LINE 256
|
||||
|
||||
#define MAX_MENUDEPTH 8
|
||||
#define MAX_MENUITEMS 64
|
||||
|
||||
#define MTYPE_NULL 0
|
||||
#define MTYPE_SLIDER 1
|
||||
#define MTYPE_ACTION 2
|
||||
#define MTYPE_SPINCONTROL 3
|
||||
#define MTYPE_FIELD 4
|
||||
#define MTYPE_RADIOBUTTON 5
|
||||
#define MTYPE_BITMAP 6
|
||||
#define MTYPE_TEXT 7
|
||||
#define MTYPE_SCROLLLIST 8
|
||||
#define MTYPE_PTEXT 9
|
||||
#define MTYPE_BTEXT 10
|
||||
|
||||
#define QMF_BLINK 0x00000001
|
||||
#define QMF_SMALLFONT 0x00000002
|
||||
#define QMF_LEFT_JUSTIFY 0x00000004
|
||||
#define QMF_CENTER_JUSTIFY 0x00000008
|
||||
#define QMF_RIGHT_JUSTIFY 0x00000010
|
||||
#define QMF_NUMBERSONLY 0x00000020 // edit field is only numbers
|
||||
#define QMF_HIGHLIGHT 0x00000040
|
||||
#define QMF_HIGHLIGHT_IF_FOCUS 0x00000080 // steady focus
|
||||
#define QMF_PULSEIFFOCUS 0x00000100 // pulse if focus
|
||||
#define QMF_HASMOUSEFOCUS 0x00000200
|
||||
#define QMF_NOONOFFTEXT 0x00000400
|
||||
#define QMF_MOUSEONLY 0x00000800 // only mouse input allowed
|
||||
#define QMF_HIDDEN 0x00001000 // skips drawing
|
||||
#define QMF_GRAYED 0x00002000 // grays and disables
|
||||
#define QMF_INACTIVE 0x00004000 // disables any input
|
||||
#define QMF_NODEFAULTINIT 0x00008000 // skip default initialization
|
||||
#define QMF_OWNERDRAW 0x00010000
|
||||
#define QMF_PULSE 0x00020000
|
||||
#define QMF_LOWERCASE 0x00040000 // edit field is all lower case
|
||||
#define QMF_UPPERCASE 0x00080000 // edit field is all upper case
|
||||
#define QMF_SILENT 0x00100000
|
||||
|
||||
// callback notifications
|
||||
#define QM_GOTFOCUS 1
|
||||
#define QM_LOSTFOCUS 2
|
||||
#define QM_ACTIVATED 3
|
||||
|
||||
typedef struct _tag_menuframework
|
||||
{
|
||||
int cursor;
|
||||
int cursor_prev;
|
||||
|
||||
int nitems;
|
||||
void *items[MAX_MENUITEMS];
|
||||
|
||||
void (*draw) (void);
|
||||
sfxHandle_t (*key) (int key);
|
||||
|
||||
qboolean wrapAround;
|
||||
qboolean fullscreen;
|
||||
qboolean showlogo;
|
||||
} menuframework_s;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int type;
|
||||
const char *name;
|
||||
int id;
|
||||
int x, y;
|
||||
int left;
|
||||
int top;
|
||||
int right;
|
||||
int bottom;
|
||||
menuframework_s *parent;
|
||||
int menuPosition;
|
||||
unsigned flags;
|
||||
|
||||
void (*callback)( void *self, int event );
|
||||
void (*statusbar)( void *self );
|
||||
void (*ownerdraw)( void *self );
|
||||
} menucommon_s;
|
||||
|
||||
typedef struct {
|
||||
int cursor;
|
||||
int scroll;
|
||||
int widthInChars;
|
||||
char buffer[MAX_EDIT_LINE];
|
||||
int maxchars;
|
||||
} mfield_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
menucommon_s generic;
|
||||
mfield_t field;
|
||||
} menufield_s;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
menucommon_s generic;
|
||||
|
||||
float minvalue;
|
||||
float maxvalue;
|
||||
float curvalue;
|
||||
|
||||
float range;
|
||||
} menuslider_s;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
menucommon_s generic;
|
||||
|
||||
int oldvalue;
|
||||
int curvalue;
|
||||
int numitems;
|
||||
int top;
|
||||
|
||||
const char **itemnames;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
int columns;
|
||||
int seperation;
|
||||
} menulist_s;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
menucommon_s generic;
|
||||
} menuaction_s;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
menucommon_s generic;
|
||||
int curvalue;
|
||||
} menuradiobutton_s;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
menucommon_s generic;
|
||||
char* focuspic;
|
||||
char* errorpic;
|
||||
qhandle_t shader;
|
||||
qhandle_t focusshader;
|
||||
int width;
|
||||
int height;
|
||||
float* focuscolor;
|
||||
} menubitmap_s;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
menucommon_s generic;
|
||||
char* string;
|
||||
int style;
|
||||
float* color;
|
||||
} menutext_s;
|
||||
|
||||
extern void Menu_Cache( void );
|
||||
extern void Menu_Focus( menucommon_s *m );
|
||||
extern void Menu_AddItem( menuframework_s *menu, void *item );
|
||||
extern void Menu_AdjustCursor( menuframework_s *menu, int dir );
|
||||
extern void Menu_Draw( menuframework_s *menu );
|
||||
extern void *Menu_ItemAtCursor( menuframework_s *m );
|
||||
extern sfxHandle_t Menu_ActivateItem( menuframework_s *s, menucommon_s* item );
|
||||
extern void Menu_SetCursor( menuframework_s *s, int cursor );
|
||||
extern void Menu_SetCursorToItem( menuframework_s *m, void* ptr );
|
||||
extern sfxHandle_t Menu_DefaultKey( menuframework_s *s, int key );
|
||||
extern void Bitmap_Init( menubitmap_s *b );
|
||||
extern void Bitmap_Draw( menubitmap_s *b );
|
||||
extern void ScrollList_Draw( menulist_s *l );
|
||||
extern sfxHandle_t ScrollList_Key( menulist_s *l, int key );
|
||||
extern sfxHandle_t menu_in_sound;
|
||||
extern sfxHandle_t menu_move_sound;
|
||||
extern sfxHandle_t menu_out_sound;
|
||||
extern sfxHandle_t menu_buzz_sound;
|
||||
extern sfxHandle_t menu_null_sound;
|
||||
extern sfxHandle_t weaponChangeSound;
|
||||
extern vec4_t menu_text_color;
|
||||
extern vec4_t menu_grayed_color;
|
||||
extern vec4_t menu_dark_color;
|
||||
extern vec4_t menu_highlight_color;
|
||||
extern vec4_t menu_red_color;
|
||||
extern vec4_t menu_black_color;
|
||||
extern vec4_t menu_dim_color;
|
||||
extern vec4_t color_black;
|
||||
extern vec4_t color_white;
|
||||
extern vec4_t color_yellow;
|
||||
extern vec4_t color_blue;
|
||||
extern vec4_t color_orange;
|
||||
extern vec4_t color_red;
|
||||
extern vec4_t color_dim;
|
||||
extern vec4_t name_color;
|
||||
extern vec4_t list_color;
|
||||
extern vec4_t listbar_color;
|
||||
extern vec4_t text_color_disabled;
|
||||
extern vec4_t text_color_normal;
|
||||
extern vec4_t text_color_highlight;
|
||||
|
||||
extern char *ui_medalNames[];
|
||||
extern char *ui_medalPicNames[];
|
||||
extern char *ui_medalSounds[];
|
||||
|
||||
//
|
||||
// ui_mfield.c
|
||||
//
|
||||
extern void MField_Clear( mfield_t *edit );
|
||||
extern void MField_KeyDownEvent( mfield_t *edit, int key );
|
||||
extern void MField_CharEvent( mfield_t *edit, int ch );
|
||||
extern void MField_Draw( mfield_t *edit, int x, int y, int style, vec4_t color );
|
||||
extern void MenuField_Init( menufield_s* m );
|
||||
extern void MenuField_Draw( menufield_s *f );
|
||||
extern sfxHandle_t MenuField_Key( menufield_s* m, int* key );
|
||||
|
||||
//
|
||||
// ui_menu.c
|
||||
//
|
||||
extern void MainMenu_Cache( void );
|
||||
extern void UI_MainMenu(void);
|
||||
extern void UI_RegisterCvars( void );
|
||||
extern void UI_UpdateCvars( void );
|
||||
|
||||
//
|
||||
// ui_credits.c
|
||||
//
|
||||
extern void UI_CreditMenu( void );
|
||||
|
||||
//
|
||||
// ui_ingame.c
|
||||
//
|
||||
extern void InGame_Cache( void );
|
||||
extern void UI_InGameMenu(void);
|
||||
|
||||
//
|
||||
// ui_confirm.c
|
||||
//
|
||||
extern void ConfirmMenu_Cache( void );
|
||||
extern void UI_ConfirmMenu( const char *question, void (*draw)( void ), void (*action)( qboolean result ) );
|
||||
extern void UI_ConfirmMenu_Style( const char *question, int style, void (*draw)( void ), void (*action)( qboolean result ) );
|
||||
extern void UI_Message( const char **lines );
|
||||
|
||||
//
|
||||
// ui_setup.c
|
||||
//
|
||||
extern void UI_SetupMenu_Cache( void );
|
||||
extern void UI_SetupMenu(void);
|
||||
|
||||
//
|
||||
// ui_team.c
|
||||
//
|
||||
extern void UI_TeamMainMenu( void );
|
||||
extern void TeamMain_Cache( void );
|
||||
|
||||
//
|
||||
// ui_connect.c
|
||||
//
|
||||
extern void UI_DrawConnectScreen( qboolean overlay );
|
||||
|
||||
//
|
||||
// ui_controls2.c
|
||||
//
|
||||
extern void UI_ControlsMenu( void );
|
||||
extern void Controls_Cache( void );
|
||||
|
||||
//
|
||||
// ui_demo2.c
|
||||
//
|
||||
extern void UI_DemosMenu( void );
|
||||
extern void Demos_Cache( void );
|
||||
|
||||
//
|
||||
// ui_cinematics.c
|
||||
//
|
||||
extern void UI_CinematicsMenu( void );
|
||||
extern void UI_CinematicsMenu_f( void );
|
||||
extern void UI_CinematicsMenu_Cache( void );
|
||||
|
||||
//
|
||||
// ui_mods.c
|
||||
//
|
||||
extern void UI_ModsMenu( void );
|
||||
extern void UI_ModsMenu_Cache( void );
|
||||
|
||||
//
|
||||
// ui_cdkey.c
|
||||
//
|
||||
extern void UI_CDKeyMenu( void );
|
||||
extern void UI_CDKeyMenu_Cache( void );
|
||||
extern void UI_CDKeyMenu_f( void );
|
||||
|
||||
//
|
||||
// ui_playermodel.c
|
||||
//
|
||||
extern void UI_PlayerModelMenu( void );
|
||||
extern void PlayerModel_Cache( void );
|
||||
|
||||
//
|
||||
// ui_playersettings.c
|
||||
//
|
||||
extern void UI_PlayerSettingsMenu( void );
|
||||
extern void PlayerSettings_Cache( void );
|
||||
|
||||
//
|
||||
// ui_preferences.c
|
||||
//
|
||||
extern void UI_PreferencesMenu( void );
|
||||
extern void Preferences_Cache( void );
|
||||
|
||||
//
|
||||
// ui_specifyleague.c
|
||||
//
|
||||
extern void UI_SpecifyLeagueMenu( void );
|
||||
extern void SpecifyLeague_Cache( void );
|
||||
|
||||
//
|
||||
// ui_specifyserver.c
|
||||
//
|
||||
extern void UI_SpecifyServerMenu( void );
|
||||
extern void SpecifyServer_Cache( void );
|
||||
|
||||
//
|
||||
// ui_servers2.c
|
||||
//
|
||||
#define MAX_FAVORITESERVERS 16
|
||||
|
||||
extern void UI_ArenaServersMenu( void );
|
||||
extern void ArenaServers_Cache( void );
|
||||
|
||||
//
|
||||
// ui_startserver.c
|
||||
//
|
||||
extern void UI_StartServerMenu( qboolean multiplayer );
|
||||
extern void StartServer_Cache( void );
|
||||
extern void ServerOptions_Cache( void );
|
||||
extern void UI_BotSelectMenu( char *bot );
|
||||
extern void UI_BotSelectMenu_Cache( void );
|
||||
|
||||
//
|
||||
// ui_serverinfo.c
|
||||
//
|
||||
extern void UI_ServerInfoMenu( void );
|
||||
extern void ServerInfo_Cache( void );
|
||||
|
||||
//
|
||||
// ui_video.c
|
||||
//
|
||||
extern void UI_GraphicsOptionsMenu( void );
|
||||
extern void GraphicsOptions_Cache( void );
|
||||
extern void DriverInfo_Cache( void );
|
||||
|
||||
//
|
||||
// ui_players.c
|
||||
//
|
||||
|
||||
//FIXME ripped from cg_local.h
|
||||
typedef struct {
|
||||
int oldFrame;
|
||||
int oldFrameTime; // time when ->oldFrame was exactly on
|
||||
|
||||
int frame;
|
||||
int frameTime; // time when ->frame will be exactly on
|
||||
|
||||
float backlerp;
|
||||
|
||||
float yawAngle;
|
||||
qboolean yawing;
|
||||
float pitchAngle;
|
||||
qboolean pitching;
|
||||
|
||||
int animationNumber; // may include ANIM_TOGGLEBIT
|
||||
animation_t *animation;
|
||||
int animationTime; // time when the first frame of the animation will be exact
|
||||
} lerpFrame_t;
|
||||
|
||||
typedef struct {
|
||||
// model info
|
||||
qhandle_t legsModel;
|
||||
qhandle_t legsSkin;
|
||||
lerpFrame_t legs;
|
||||
|
||||
qhandle_t torsoModel;
|
||||
qhandle_t torsoSkin;
|
||||
lerpFrame_t torso;
|
||||
|
||||
qhandle_t headModel;
|
||||
qhandle_t headSkin;
|
||||
|
||||
animation_t animations[MAX_ANIMATIONS];
|
||||
|
||||
qhandle_t weaponModel;
|
||||
qhandle_t barrelModel;
|
||||
qhandle_t flashModel;
|
||||
vec3_t flashDlightColor;
|
||||
int muzzleFlashTime;
|
||||
|
||||
// currently in use drawing parms
|
||||
vec3_t viewAngles;
|
||||
vec3_t moveAngles;
|
||||
weapon_t currentWeapon;
|
||||
int legsAnim;
|
||||
int torsoAnim;
|
||||
|
||||
// animation vars
|
||||
weapon_t weapon;
|
||||
weapon_t lastWeapon;
|
||||
weapon_t pendingWeapon;
|
||||
int weaponTimer;
|
||||
int pendingLegsAnim;
|
||||
int torsoAnimationTimer;
|
||||
|
||||
int pendingTorsoAnim;
|
||||
int legsAnimationTimer;
|
||||
|
||||
qboolean chat;
|
||||
qboolean newModel;
|
||||
|
||||
qboolean barrelSpinning;
|
||||
float barrelAngle;
|
||||
int barrelTime;
|
||||
|
||||
int realWeapon;
|
||||
} playerInfo_t;
|
||||
|
||||
void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int time );
|
||||
void UI_PlayerInfo_SetModel( playerInfo_t *pi, const char *model );
|
||||
void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNum, qboolean chat );
|
||||
qboolean UI_RegisterClientModelname( playerInfo_t *pi, const char *modelSkinName );
|
||||
|
||||
//
|
||||
// ui_atoms.c
|
||||
//
|
||||
typedef struct {
|
||||
int frametime;
|
||||
int realtime;
|
||||
int cursorx;
|
||||
int cursory;
|
||||
int menusp;
|
||||
menuframework_s* activemenu;
|
||||
menuframework_s* stack[MAX_MENUDEPTH];
|
||||
glconfig_t glconfig;
|
||||
qboolean debug;
|
||||
qhandle_t whiteShader;
|
||||
qhandle_t menuBackShader;
|
||||
qhandle_t menuBackNoLogoShader;
|
||||
qhandle_t charset;
|
||||
qhandle_t charsetProp;
|
||||
qhandle_t charsetPropGlow;
|
||||
qhandle_t charsetPropB;
|
||||
qhandle_t cursor;
|
||||
qhandle_t rb_on;
|
||||
qhandle_t rb_off;
|
||||
float scale;
|
||||
float bias;
|
||||
qboolean demoversion;
|
||||
qboolean firstdraw;
|
||||
} uiStatic_t;
|
||||
|
||||
extern void UI_Init( void );
|
||||
extern void UI_Shutdown( void );
|
||||
extern void UI_KeyEvent( int key, int down );
|
||||
extern void UI_MouseEvent( int dx, int dy );
|
||||
extern void UI_Refresh( int realtime );
|
||||
extern qboolean UI_ConsoleCommand( int realTime );
|
||||
extern float UI_ClampCvar( float min, float max, float value );
|
||||
extern void UI_DrawNamedPic( float x, float y, float width, float height, const char *picname );
|
||||
extern void UI_DrawHandlePic( float x, float y, float w, float h, qhandle_t hShader );
|
||||
extern void UI_FillRect( float x, float y, float width, float height, const float *color );
|
||||
extern void UI_DrawRect( float x, float y, float width, float height, const float *color );
|
||||
extern void UI_UpdateScreen( void );
|
||||
extern void UI_SetColor( const float *rgba );
|
||||
extern void UI_LerpColor(vec4_t a, vec4_t b, vec4_t c, float t);
|
||||
extern void UI_DrawBannerString( int x, int y, const char* str, int style, vec4_t color );
|
||||
extern float UI_ProportionalSizeScale( int style );
|
||||
extern void UI_DrawProportionalString( int x, int y, const char* str, int style, vec4_t color );
|
||||
extern void UI_DrawProportionalString_AutoWrapped( int x, int ystart, int xmax, int ystep, const char* str, int style, vec4_t color );
|
||||
extern int UI_ProportionalStringWidth( const char* str );
|
||||
extern void UI_DrawString( int x, int y, const char* str, int style, vec4_t color );
|
||||
extern void UI_DrawChar( int x, int y, int ch, int style, vec4_t color );
|
||||
extern qboolean UI_CursorInRect (int x, int y, int width, int height);
|
||||
extern void UI_AdjustFrom640( float *x, float *y, float *w, float *h );
|
||||
extern void UI_DrawTextBox (int x, int y, int width, int lines);
|
||||
extern qboolean UI_IsFullscreen( void );
|
||||
extern void UI_SetActiveMenu( uiMenuCommand_t menu );
|
||||
extern void UI_PushMenu ( menuframework_s *menu );
|
||||
extern void UI_PopMenu (void);
|
||||
extern void UI_ForceMenuOff (void);
|
||||
extern char *UI_Argv( int arg );
|
||||
extern char *UI_Cvar_VariableString( const char *var_name );
|
||||
extern void UI_Refresh( int time );
|
||||
extern void UI_StartDemoLoop( void );
|
||||
extern qboolean m_entersound;
|
||||
extern uiStatic_t uis;
|
||||
|
||||
//
|
||||
// ui_spLevel.c
|
||||
//
|
||||
void UI_SPLevelMenu_Cache( void );
|
||||
void UI_SPLevelMenu( void );
|
||||
void UI_SPLevelMenu_f( void );
|
||||
void UI_SPLevelMenu_ReInit( void );
|
||||
|
||||
//
|
||||
// ui_spArena.c
|
||||
//
|
||||
void UI_SPArena_Start( const char *arenaInfo );
|
||||
|
||||
//
|
||||
// ui_spPostgame.c
|
||||
//
|
||||
void UI_SPPostgameMenu_Cache( void );
|
||||
void UI_SPPostgameMenu_f( void );
|
||||
|
||||
//
|
||||
// ui_spSkill.c
|
||||
//
|
||||
void UI_SPSkillMenu( const char *arenaInfo );
|
||||
void UI_SPSkillMenu_Cache( void );
|
||||
|
||||
//
|
||||
// ui_syscalls.c
|
||||
//
|
||||
void trap_Print( const char *string );
|
||||
void trap_Error( const char *string );
|
||||
int trap_Milliseconds( void );
|
||||
void trap_Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags );
|
||||
void trap_Cvar_Update( vmCvar_t *vmCvar );
|
||||
void trap_Cvar_Set( const char *var_name, const char *value );
|
||||
float trap_Cvar_VariableValue( const char *var_name );
|
||||
void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize );
|
||||
void trap_Cvar_SetValue( const char *var_name, float value );
|
||||
void trap_Cvar_Reset( const char *name );
|
||||
void trap_Cvar_Create( const char *var_name, const char *var_value, int flags );
|
||||
void trap_Cvar_InfoStringBuffer( int bit, char *buffer, int bufsize );
|
||||
int trap_Argc( void );
|
||||
void trap_Argv( int n, char *buffer, int bufferLength );
|
||||
void trap_Cmd_ExecuteText( int exec_when, const char *text ); // don't use EXEC_NOW!
|
||||
int trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode );
|
||||
void trap_FS_Read( void *buffer, int len, fileHandle_t f );
|
||||
void trap_FS_Write( const void *buffer, int len, fileHandle_t f );
|
||||
void trap_FS_FCloseFile( fileHandle_t f );
|
||||
int trap_FS_GetFileList( const char *path, const char *extension, char *listbuf, int bufsize );
|
||||
int trap_FS_Seek( fileHandle_t f, long offset, int origin ); // fsOrigin_t
|
||||
qhandle_t trap_R_RegisterModel( const char *name );
|
||||
qhandle_t trap_R_RegisterSkin( const char *name );
|
||||
qhandle_t trap_R_RegisterShaderNoMip( const char *name );
|
||||
void trap_R_ClearScene( void );
|
||||
void trap_R_AddRefEntityToScene( const refEntity_t *re );
|
||||
void trap_R_AddPolyToScene( qhandle_t hShader , int numVerts, const polyVert_t *verts );
|
||||
void trap_R_AddLightToScene( const vec3_t org, float intensity, float r, float g, float b );
|
||||
void trap_R_RenderScene( const refdef_t *fd );
|
||||
void trap_R_SetColor( const float *rgba );
|
||||
void trap_R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader );
|
||||
void trap_UpdateScreen( void );
|
||||
int trap_CM_LerpTag( orientation_t *tag, clipHandle_t mod, int startFrame, int endFrame, float frac, const char *tagName );
|
||||
void trap_S_StartLocalSound( sfxHandle_t sfx, int channelNum );
|
||||
sfxHandle_t trap_S_RegisterSound( const char *sample, qboolean compressed );
|
||||
void trap_Key_KeynumToStringBuf( int keynum, char *buf, int buflen );
|
||||
void trap_Key_GetBindingBuf( int keynum, char *buf, int buflen );
|
||||
void trap_Key_SetBinding( int keynum, const char *binding );
|
||||
qboolean trap_Key_IsDown( int keynum );
|
||||
qboolean trap_Key_GetOverstrikeMode( void );
|
||||
void trap_Key_SetOverstrikeMode( qboolean state );
|
||||
void trap_Key_ClearStates( void );
|
||||
int trap_Key_GetCatcher( void );
|
||||
void trap_Key_SetCatcher( int catcher );
|
||||
void trap_GetClipboardData( char *buf, int bufsize );
|
||||
void trap_GetClientState( uiClientState_t *state );
|
||||
void trap_GetGlconfig( glconfig_t *glconfig );
|
||||
int trap_GetConfigString( int index, char* buff, int buffsize );
|
||||
int trap_LAN_GetServerCount( int source );
|
||||
void trap_LAN_GetServerAddressString( int source, int n, char *buf, int buflen );
|
||||
void trap_LAN_GetServerInfo( int source, int n, char *buf, int buflen );
|
||||
int trap_LAN_GetPingQueueCount( void );
|
||||
int trap_LAN_ServerStatus( char *serverAddress, char *serverStatus, int maxLen );
|
||||
void trap_LAN_ClearPing( int n );
|
||||
void trap_LAN_GetPing( int n, char *buf, int buflen, int *pingtime );
|
||||
void trap_LAN_GetPingInfo( int n, char *buf, int buflen );
|
||||
int trap_MemoryRemaining( void );
|
||||
void trap_GetCDKey( char *buf, int buflen );
|
||||
void trap_SetCDKey( char *buf );
|
||||
|
||||
qboolean trap_VerifyCDKey( const char *key, const char *chksum); // bk001208 - RC4
|
||||
|
||||
void trap_SetPbClStatus( int status );
|
||||
|
||||
//
|
||||
// ui_addbots.c
|
||||
//
|
||||
void UI_AddBots_Cache( void );
|
||||
void UI_AddBotsMenu( void );
|
||||
|
||||
//
|
||||
// ui_removebots.c
|
||||
//
|
||||
void UI_RemoveBots_Cache( void );
|
||||
void UI_RemoveBotsMenu( void );
|
||||
|
||||
//
|
||||
// ui_teamorders.c
|
||||
//
|
||||
extern void UI_TeamOrdersMenu( void );
|
||||
extern void UI_TeamOrdersMenu_f( void );
|
||||
extern void UI_TeamOrdersMenu_Cache( void );
|
||||
|
||||
//
|
||||
// ui_loadconfig.c
|
||||
//
|
||||
void UI_LoadConfig_Cache( void );
|
||||
void UI_LoadConfigMenu( void );
|
||||
|
||||
//
|
||||
// ui_saveconfig.c
|
||||
//
|
||||
void UI_SaveConfigMenu_Cache( void );
|
||||
void UI_SaveConfigMenu( void );
|
||||
|
||||
//
|
||||
// ui_display.c
|
||||
//
|
||||
void UI_DisplayOptionsMenu_Cache( void );
|
||||
void UI_DisplayOptionsMenu( void );
|
||||
|
||||
//
|
||||
// ui_sound.c
|
||||
//
|
||||
void UI_SoundOptionsMenu_Cache( void );
|
||||
void UI_SoundOptionsMenu( void );
|
||||
|
||||
//
|
||||
// ui_network.c
|
||||
//
|
||||
void UI_NetworkOptionsMenu_Cache( void );
|
||||
void UI_NetworkOptionsMenu( void );
|
||||
|
||||
//
|
||||
// ui_gameinfo.c
|
||||
//
|
||||
typedef enum {
|
||||
AWARD_ACCURACY,
|
||||
AWARD_IMPRESSIVE,
|
||||
AWARD_EXCELLENT,
|
||||
AWARD_GAUNTLET,
|
||||
AWARD_FRAGS,
|
||||
AWARD_PERFECT
|
||||
} awardType_t;
|
||||
|
||||
const char *UI_GetArenaInfoByNumber( int num );
|
||||
const char *UI_GetArenaInfoByMap( const char *map );
|
||||
const char *UI_GetSpecialArenaInfo( const char *tag );
|
||||
int UI_GetNumArenas( void );
|
||||
int UI_GetNumSPArenas( void );
|
||||
int UI_GetNumSPTiers( void );
|
||||
|
||||
char *UI_GetBotInfoByNumber( int num );
|
||||
char *UI_GetBotInfoByName( const char *name );
|
||||
int UI_GetNumBots( void );
|
||||
|
||||
void UI_GetBestScore( int level, int *score, int *skill );
|
||||
void UI_SetBestScore( int level, int score );
|
||||
int UI_TierCompleted( int levelWon );
|
||||
qboolean UI_ShowTierVideo( int tier );
|
||||
qboolean UI_CanShowTierVideo( int tier );
|
||||
int UI_GetCurrentGame( void );
|
||||
void UI_NewGame( void );
|
||||
void UI_LogAwardData( int award, int data );
|
||||
int UI_GetAwardLevel( int award );
|
||||
|
||||
void UI_SPUnlock_f( void );
|
||||
void UI_SPUnlockMedals_f( void );
|
||||
|
||||
void UI_InitGameinfo( void );
|
||||
|
||||
//GRank
|
||||
|
||||
//
|
||||
// ui_rankings.c
|
||||
//
|
||||
void Rankings_DrawText( void* self );
|
||||
void Rankings_DrawName( void* self );
|
||||
void Rankings_DrawPassword( void* self );
|
||||
void Rankings_Cache( void );
|
||||
void UI_RankingsMenu( void );
|
||||
|
||||
//
|
||||
// ui_login.c
|
||||
//
|
||||
void Login_Cache( void );
|
||||
void UI_LoginMenu( void );
|
||||
|
||||
//
|
||||
// ui_signup.c
|
||||
//
|
||||
void Signup_Cache( void );
|
||||
void UI_SignupMenu( void );
|
||||
|
||||
//
|
||||
// ui_rankstatus.c
|
||||
//
|
||||
void RankStatus_Cache( void );
|
||||
void UI_RankStatusMenu( void );
|
||||
|
||||
#endif
|
||||
188
code/q3_ui/.svn/text-base/ui_login.c.svn-base
Executable file
188
code/q3_ui/.svn/text-base/ui_login.c.svn-base
Executable file
@@ -0,0 +1,188 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
//
|
||||
// ui_login.c
|
||||
//
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define LOGIN_FRAME "menu/art/cut_frame"
|
||||
|
||||
#define ID_NAME 100
|
||||
#define ID_NAME_BOX 101
|
||||
#define ID_PASSWORD 102
|
||||
#define ID_PASSWORD_BOX 103
|
||||
#define ID_LOGIN 104
|
||||
#define ID_CANCEL 105
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
menuframework_s menu;
|
||||
menubitmap_s frame;
|
||||
menutext_s name;
|
||||
menufield_s name_box;
|
||||
menutext_s password;
|
||||
menufield_s password_box;
|
||||
menutext_s login;
|
||||
menutext_s cancel;
|
||||
} login_t;
|
||||
|
||||
static login_t s_login;
|
||||
|
||||
static menuframework_s s_login_menu;
|
||||
static menuaction_s s_login_login;
|
||||
static menuaction_s s_login_cancel;
|
||||
|
||||
static vec4_t s_login_color_prompt = {1.00, 0.43, 0.00, 1.00};
|
||||
|
||||
/*
|
||||
===============
|
||||
Login_MenuEvent
|
||||
===============
|
||||
*/
|
||||
static void Login_MenuEvent( void* ptr, int event ) {
|
||||
if( event != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch( ((menucommon_s*)ptr)->id ) {
|
||||
case ID_LOGIN:
|
||||
// set name ``
|
||||
//trap_Cvar_Set( "name", s_login.name_box.field.buffer );
|
||||
/*
|
||||
trap_Cvar_Set( "rank_name", s_login.name_box.field.buffer );
|
||||
trap_Cvar_Set( "rank_pwd", s_login.password_box.field.buffer );
|
||||
*/
|
||||
|
||||
// login
|
||||
trap_CL_UI_RankUserLogin(
|
||||
s_login.name_box.field.buffer,
|
||||
s_login.password_box.field.buffer );
|
||||
|
||||
UI_ForceMenuOff();
|
||||
break;
|
||||
|
||||
case ID_CANCEL:
|
||||
UI_PopMenu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
Login_MenuInit
|
||||
===============
|
||||
*/
|
||||
void Login_MenuInit( void ) {
|
||||
int y;
|
||||
|
||||
memset( &s_login, 0, sizeof(s_login) );
|
||||
|
||||
Login_Cache();
|
||||
|
||||
s_login.menu.wrapAround = qtrue;
|
||||
s_login.menu.fullscreen = qfalse;
|
||||
|
||||
s_login.frame.generic.type = MTYPE_BITMAP;
|
||||
s_login.frame.generic.flags = QMF_INACTIVE;
|
||||
s_login.frame.generic.name = LOGIN_FRAME;
|
||||
s_login.frame.generic.x = 142; //320-233;
|
||||
s_login.frame.generic.y = 118; //240-166;
|
||||
s_login.frame.width = 359; //466;
|
||||
s_login.frame.height = 256; //332;
|
||||
|
||||
y = 214;
|
||||
|
||||
s_login.name.generic.type = MTYPE_PTEXT;
|
||||
s_login.name.generic.flags = QMF_RIGHT_JUSTIFY|QMF_INACTIVE;
|
||||
s_login.name.generic.id = ID_NAME;
|
||||
s_login.name.generic.x = 310;
|
||||
s_login.name.generic.y = y;
|
||||
s_login.name.string = "NAME";
|
||||
s_login.name.style = UI_RIGHT|UI_SMALLFONT;
|
||||
s_login.name.color = s_login_color_prompt;
|
||||
|
||||
s_login.name_box.generic.type = MTYPE_FIELD;
|
||||
s_login.name_box.generic.ownerdraw = Rankings_DrawName;
|
||||
s_login.name_box.generic.name = "";
|
||||
s_login.name_box.generic.flags = 0;
|
||||
s_login.name_box.generic.x = 330;
|
||||
s_login.name_box.generic.y = y;
|
||||
s_login.name_box.field.widthInChars = 16;
|
||||
s_login.name_box.field.maxchars = 16;
|
||||
y += 20;
|
||||
|
||||
s_login.password.generic.type = MTYPE_PTEXT;
|
||||
s_login.password.generic.flags = QMF_RIGHT_JUSTIFY|QMF_INACTIVE;
|
||||
s_login.password.generic.id = ID_PASSWORD;
|
||||
s_login.password.generic.x = 310;
|
||||
s_login.password.generic.y = y;
|
||||
s_login.password.string = "PASSWORD";
|
||||
s_login.password.style = UI_RIGHT|UI_SMALLFONT;
|
||||
s_login.password.color = s_login_color_prompt;
|
||||
|
||||
s_login.password_box.generic.type = MTYPE_FIELD;
|
||||
s_login.password_box.generic.ownerdraw = Rankings_DrawPassword;
|
||||
s_login.password_box.generic.name = "";
|
||||
s_login.password_box.generic.flags = 0;
|
||||
s_login.password_box.generic.x = 330;
|
||||
s_login.password_box.generic.y = y;
|
||||
s_login.password_box.field.widthInChars = 16;
|
||||
s_login.password_box.field.maxchars = 16;
|
||||
y += 40;
|
||||
|
||||
s_login.login.generic.type = MTYPE_PTEXT;
|
||||
s_login.login.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_login.login.generic.id = ID_LOGIN;
|
||||
s_login.login.generic.callback = Login_MenuEvent;
|
||||
s_login.login.generic.x = 310;
|
||||
s_login.login.generic.y = y;
|
||||
s_login.login.string = "LOGIN";
|
||||
s_login.login.style = UI_RIGHT|UI_SMALLFONT;
|
||||
s_login.login.color = colorRed;
|
||||
|
||||
s_login.cancel.generic.type = MTYPE_PTEXT;
|
||||
s_login.cancel.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_login.cancel.generic.id = ID_CANCEL;
|
||||
s_login.cancel.generic.callback = Login_MenuEvent;
|
||||
s_login.cancel.generic.x = 330;
|
||||
s_login.cancel.generic.y = y;
|
||||
s_login.cancel.string = "CANCEL";
|
||||
s_login.cancel.style = UI_LEFT|UI_SMALLFONT;
|
||||
s_login.cancel.color = colorRed;
|
||||
y += 20;
|
||||
|
||||
Menu_AddItem( &s_login.menu, (void*) &s_login.frame );
|
||||
Menu_AddItem( &s_login.menu, (void*) &s_login.name );
|
||||
Menu_AddItem( &s_login.menu, (void*) &s_login.name_box );
|
||||
Menu_AddItem( &s_login.menu, (void*) &s_login.password );
|
||||
Menu_AddItem( &s_login.menu, (void*) &s_login.password_box );
|
||||
Menu_AddItem( &s_login.menu, (void*) &s_login.login );
|
||||
Menu_AddItem( &s_login.menu, (void*) &s_login.cancel );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
Login_Cache
|
||||
===============
|
||||
*/
|
||||
void Login_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( LOGIN_FRAME );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_LoginMenu
|
||||
===============
|
||||
*/
|
||||
void UI_LoginMenu( void ) {
|
||||
Login_MenuInit();
|
||||
UI_PushMenu ( &s_login.menu );
|
||||
}
|
||||
|
||||
|
||||
229
code/q3_ui/.svn/text-base/ui_main.c.svn-base
Executable file
229
code/q3_ui/.svn/text-base/ui_main.c.svn-base
Executable file
@@ -0,0 +1,229 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
/*
|
||||
=======================================================================
|
||||
|
||||
USER INTERFACE MAIN
|
||||
|
||||
=======================================================================
|
||||
*/
|
||||
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
vmMain
|
||||
|
||||
This is the only way control passes into the module.
|
||||
This must be the very first function compiled into the .qvm file
|
||||
================
|
||||
*/
|
||||
int vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11 ) {
|
||||
switch ( command ) {
|
||||
case UI_GETAPIVERSION:
|
||||
return UI_API_VERSION;
|
||||
|
||||
case UI_INIT:
|
||||
UI_Init();
|
||||
return 0;
|
||||
|
||||
case UI_SHUTDOWN:
|
||||
UI_Shutdown();
|
||||
return 0;
|
||||
|
||||
case UI_KEY_EVENT:
|
||||
UI_KeyEvent( arg0, arg1 );
|
||||
return 0;
|
||||
|
||||
case UI_MOUSE_EVENT:
|
||||
UI_MouseEvent( arg0, arg1 );
|
||||
return 0;
|
||||
|
||||
case UI_REFRESH:
|
||||
UI_Refresh( arg0 );
|
||||
return 0;
|
||||
|
||||
case UI_IS_FULLSCREEN:
|
||||
return UI_IsFullscreen();
|
||||
|
||||
case UI_SET_ACTIVE_MENU:
|
||||
UI_SetActiveMenu( arg0 );
|
||||
return 0;
|
||||
|
||||
case UI_CONSOLE_COMMAND:
|
||||
return UI_ConsoleCommand(arg0);
|
||||
|
||||
case UI_DRAW_CONNECT_SCREEN:
|
||||
UI_DrawConnectScreen( arg0 );
|
||||
return 0;
|
||||
case UI_HASUNIQUECDKEY: // mod authors need to observe this
|
||||
return qtrue; // bk010117 - change this to qfalse for mods!
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
cvars
|
||||
================
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
vmCvar_t *vmCvar;
|
||||
char *cvarName;
|
||||
char *defaultString;
|
||||
int cvarFlags;
|
||||
} cvarTable_t;
|
||||
|
||||
vmCvar_t ui_ffa_fraglimit;
|
||||
vmCvar_t ui_ffa_timelimit;
|
||||
|
||||
vmCvar_t ui_tourney_fraglimit;
|
||||
vmCvar_t ui_tourney_timelimit;
|
||||
|
||||
vmCvar_t ui_team_fraglimit;
|
||||
vmCvar_t ui_team_timelimit;
|
||||
vmCvar_t ui_team_friendly;
|
||||
|
||||
vmCvar_t ui_ctf_capturelimit;
|
||||
vmCvar_t ui_ctf_timelimit;
|
||||
vmCvar_t ui_ctf_friendly;
|
||||
|
||||
vmCvar_t ui_arenasFile;
|
||||
vmCvar_t ui_botsFile;
|
||||
vmCvar_t ui_spScores1;
|
||||
vmCvar_t ui_spScores2;
|
||||
vmCvar_t ui_spScores3;
|
||||
vmCvar_t ui_spScores4;
|
||||
vmCvar_t ui_spScores5;
|
||||
vmCvar_t ui_spAwards;
|
||||
vmCvar_t ui_spVideos;
|
||||
vmCvar_t ui_spSkill;
|
||||
|
||||
vmCvar_t ui_spSelection;
|
||||
|
||||
vmCvar_t ui_browserMaster;
|
||||
vmCvar_t ui_browserGameType;
|
||||
vmCvar_t ui_browserSortKey;
|
||||
vmCvar_t ui_browserShowFull;
|
||||
vmCvar_t ui_browserShowEmpty;
|
||||
|
||||
vmCvar_t ui_brassTime;
|
||||
vmCvar_t ui_drawCrosshair;
|
||||
vmCvar_t ui_drawCrosshairNames;
|
||||
vmCvar_t ui_marks;
|
||||
|
||||
vmCvar_t ui_server1;
|
||||
vmCvar_t ui_server2;
|
||||
vmCvar_t ui_server3;
|
||||
vmCvar_t ui_server4;
|
||||
vmCvar_t ui_server5;
|
||||
vmCvar_t ui_server6;
|
||||
vmCvar_t ui_server7;
|
||||
vmCvar_t ui_server8;
|
||||
vmCvar_t ui_server9;
|
||||
vmCvar_t ui_server10;
|
||||
vmCvar_t ui_server11;
|
||||
vmCvar_t ui_server12;
|
||||
vmCvar_t ui_server13;
|
||||
vmCvar_t ui_server14;
|
||||
vmCvar_t ui_server15;
|
||||
vmCvar_t ui_server16;
|
||||
|
||||
vmCvar_t ui_cdkeychecked;
|
||||
|
||||
// bk001129 - made static to avoid aliasing.
|
||||
static cvarTable_t cvarTable[] = {
|
||||
{ &ui_ffa_fraglimit, "ui_ffa_fraglimit", "20", CVAR_ARCHIVE },
|
||||
{ &ui_ffa_timelimit, "ui_ffa_timelimit", "0", CVAR_ARCHIVE },
|
||||
|
||||
{ &ui_tourney_fraglimit, "ui_tourney_fraglimit", "0", CVAR_ARCHIVE },
|
||||
{ &ui_tourney_timelimit, "ui_tourney_timelimit", "15", CVAR_ARCHIVE },
|
||||
|
||||
{ &ui_team_fraglimit, "ui_team_fraglimit", "0", CVAR_ARCHIVE },
|
||||
{ &ui_team_timelimit, "ui_team_timelimit", "20", CVAR_ARCHIVE },
|
||||
{ &ui_team_friendly, "ui_team_friendly", "1", CVAR_ARCHIVE },
|
||||
|
||||
{ &ui_ctf_capturelimit, "ui_ctf_capturelimit", "8", CVAR_ARCHIVE },
|
||||
{ &ui_ctf_timelimit, "ui_ctf_timelimit", "30", CVAR_ARCHIVE },
|
||||
{ &ui_ctf_friendly, "ui_ctf_friendly", "0", CVAR_ARCHIVE },
|
||||
|
||||
{ &ui_arenasFile, "g_arenasFile", "", CVAR_INIT|CVAR_ROM },
|
||||
{ &ui_botsFile, "g_botsFile", "", CVAR_INIT|CVAR_ROM },
|
||||
{ &ui_spScores1, "g_spScores1", "", CVAR_ARCHIVE | CVAR_ROM },
|
||||
{ &ui_spScores2, "g_spScores2", "", CVAR_ARCHIVE | CVAR_ROM },
|
||||
{ &ui_spScores3, "g_spScores3", "", CVAR_ARCHIVE | CVAR_ROM },
|
||||
{ &ui_spScores4, "g_spScores4", "", CVAR_ARCHIVE | CVAR_ROM },
|
||||
{ &ui_spScores5, "g_spScores5", "", CVAR_ARCHIVE | CVAR_ROM },
|
||||
{ &ui_spAwards, "g_spAwards", "", CVAR_ARCHIVE | CVAR_ROM },
|
||||
{ &ui_spVideos, "g_spVideos", "", CVAR_ARCHIVE | CVAR_ROM },
|
||||
{ &ui_spSkill, "g_spSkill", "2", CVAR_ARCHIVE | CVAR_LATCH },
|
||||
|
||||
{ &ui_spSelection, "ui_spSelection", "", CVAR_ROM },
|
||||
|
||||
{ &ui_browserMaster, "ui_browserMaster", "0", CVAR_ARCHIVE },
|
||||
{ &ui_browserGameType, "ui_browserGameType", "0", CVAR_ARCHIVE },
|
||||
{ &ui_browserSortKey, "ui_browserSortKey", "4", CVAR_ARCHIVE },
|
||||
{ &ui_browserShowFull, "ui_browserShowFull", "1", CVAR_ARCHIVE },
|
||||
{ &ui_browserShowEmpty, "ui_browserShowEmpty", "1", CVAR_ARCHIVE },
|
||||
|
||||
{ &ui_brassTime, "cg_brassTime", "2500", CVAR_ARCHIVE },
|
||||
{ &ui_drawCrosshair, "cg_drawCrosshair", "4", CVAR_ARCHIVE },
|
||||
{ &ui_drawCrosshairNames, "cg_drawCrosshairNames", "1", CVAR_ARCHIVE },
|
||||
{ &ui_marks, "cg_marks", "1", CVAR_ARCHIVE },
|
||||
|
||||
{ &ui_server1, "server1", "", CVAR_ARCHIVE },
|
||||
{ &ui_server2, "server2", "", CVAR_ARCHIVE },
|
||||
{ &ui_server3, "server3", "", CVAR_ARCHIVE },
|
||||
{ &ui_server4, "server4", "", CVAR_ARCHIVE },
|
||||
{ &ui_server5, "server5", "", CVAR_ARCHIVE },
|
||||
{ &ui_server6, "server6", "", CVAR_ARCHIVE },
|
||||
{ &ui_server7, "server7", "", CVAR_ARCHIVE },
|
||||
{ &ui_server8, "server8", "", CVAR_ARCHIVE },
|
||||
{ &ui_server9, "server9", "", CVAR_ARCHIVE },
|
||||
{ &ui_server10, "server10", "", CVAR_ARCHIVE },
|
||||
{ &ui_server11, "server11", "", CVAR_ARCHIVE },
|
||||
{ &ui_server12, "server12", "", CVAR_ARCHIVE },
|
||||
{ &ui_server13, "server13", "", CVAR_ARCHIVE },
|
||||
{ &ui_server14, "server14", "", CVAR_ARCHIVE },
|
||||
{ &ui_server15, "server15", "", CVAR_ARCHIVE },
|
||||
{ &ui_server16, "server16", "", CVAR_ARCHIVE },
|
||||
|
||||
{ &ui_cdkeychecked, "ui_cdkeychecked", "0", CVAR_ROM }
|
||||
};
|
||||
|
||||
// bk001129 - made static to avoid aliasing
|
||||
static int cvarTableSize = sizeof(cvarTable) / sizeof(cvarTable[0]);
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_RegisterCvars
|
||||
=================
|
||||
*/
|
||||
void UI_RegisterCvars( void ) {
|
||||
int i;
|
||||
cvarTable_t *cv;
|
||||
|
||||
for ( i = 0, cv = cvarTable ; i < cvarTableSize ; i++, cv++ ) {
|
||||
trap_Cvar_Register( cv->vmCvar, cv->cvarName, cv->defaultString, cv->cvarFlags );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_UpdateCvars
|
||||
=================
|
||||
*/
|
||||
void UI_UpdateCvars( void ) {
|
||||
int i;
|
||||
cvarTable_t *cv;
|
||||
|
||||
for ( i = 0, cv = cvarTable ; i < cvarTableSize ; i++, cv++ ) {
|
||||
trap_Cvar_Update( cv->vmCvar );
|
||||
}
|
||||
}
|
||||
399
code/q3_ui/.svn/text-base/ui_menu.c.svn-base
Executable file
399
code/q3_ui/.svn/text-base/ui_menu.c.svn-base
Executable file
@@ -0,0 +1,399 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
/*
|
||||
=======================================================================
|
||||
|
||||
MAIN MENU
|
||||
|
||||
=======================================================================
|
||||
*/
|
||||
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define ID_SINGLEPLAYER 10
|
||||
#define ID_MULTIPLAYER 11
|
||||
#define ID_SETUP 12
|
||||
#define ID_DEMOS 13
|
||||
#define ID_CINEMATICS 14
|
||||
#define ID_TEAMARENA 15
|
||||
#define ID_MODS 16
|
||||
#define ID_EXIT 17
|
||||
|
||||
#define MAIN_BANNER_MODEL "models/mapobjects/banner/banner5.md3"
|
||||
#define MAIN_MENU_VERTICAL_SPACING 34
|
||||
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
|
||||
menutext_s singleplayer;
|
||||
menutext_s multiplayer;
|
||||
menutext_s setup;
|
||||
menutext_s demos;
|
||||
menutext_s cinematics;
|
||||
menutext_s teamArena;
|
||||
menutext_s mods;
|
||||
menutext_s exit;
|
||||
|
||||
qhandle_t bannerModel;
|
||||
} mainmenu_t;
|
||||
|
||||
|
||||
static mainmenu_t s_main;
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
char errorMessage[4096];
|
||||
} errorMessage_t;
|
||||
|
||||
static errorMessage_t s_errorMessage;
|
||||
|
||||
/*
|
||||
=================
|
||||
MainMenu_ExitAction
|
||||
=================
|
||||
*/
|
||||
static void MainMenu_ExitAction( qboolean result ) {
|
||||
if( !result ) {
|
||||
return;
|
||||
}
|
||||
UI_PopMenu();
|
||||
UI_CreditMenu();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
Main_MenuEvent
|
||||
=================
|
||||
*/
|
||||
void Main_MenuEvent (void* ptr, int event) {
|
||||
if( event != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch( ((menucommon_s*)ptr)->id ) {
|
||||
case ID_SINGLEPLAYER:
|
||||
UI_SPLevelMenu();
|
||||
break;
|
||||
|
||||
case ID_MULTIPLAYER:
|
||||
UI_ArenaServersMenu();
|
||||
break;
|
||||
|
||||
case ID_SETUP:
|
||||
UI_SetupMenu();
|
||||
break;
|
||||
|
||||
case ID_DEMOS:
|
||||
UI_DemosMenu();
|
||||
break;
|
||||
|
||||
case ID_CINEMATICS:
|
||||
UI_CinematicsMenu();
|
||||
break;
|
||||
|
||||
case ID_MODS:
|
||||
UI_ModsMenu();
|
||||
break;
|
||||
|
||||
case ID_TEAMARENA:
|
||||
trap_Cvar_Set( "fs_game", "missionpack");
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart;" );
|
||||
break;
|
||||
|
||||
case ID_EXIT:
|
||||
UI_ConfirmMenu( "EXIT GAME?", NULL, MainMenu_ExitAction );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
MainMenu_Cache
|
||||
===============
|
||||
*/
|
||||
void MainMenu_Cache( void ) {
|
||||
s_main.bannerModel = trap_R_RegisterModel( MAIN_BANNER_MODEL );
|
||||
}
|
||||
|
||||
sfxHandle_t ErrorMessage_Key(int key)
|
||||
{
|
||||
trap_Cvar_Set( "com_errorMessage", "" );
|
||||
UI_MainMenu();
|
||||
return (menu_null_sound);
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
Main_MenuDraw
|
||||
TTimo: this function is common to the main menu and errorMessage menu
|
||||
===============
|
||||
*/
|
||||
|
||||
static void Main_MenuDraw( void ) {
|
||||
refdef_t refdef;
|
||||
refEntity_t ent;
|
||||
vec3_t origin;
|
||||
vec3_t angles;
|
||||
float adjust;
|
||||
float x, y, w, h;
|
||||
vec4_t color = {0.5, 0, 0, 1};
|
||||
|
||||
// setup the refdef
|
||||
|
||||
memset( &refdef, 0, sizeof( refdef ) );
|
||||
|
||||
refdef.rdflags = RDF_NOWORLDMODEL;
|
||||
|
||||
AxisClear( refdef.viewaxis );
|
||||
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = 640;
|
||||
h = 120;
|
||||
UI_AdjustFrom640( &x, &y, &w, &h );
|
||||
refdef.x = x;
|
||||
refdef.y = y;
|
||||
refdef.width = w;
|
||||
refdef.height = h;
|
||||
|
||||
adjust = 0; // JDC: Kenneth asked me to stop this 1.0 * sin( (float)uis.realtime / 1000 );
|
||||
refdef.fov_x = 60 + adjust;
|
||||
refdef.fov_y = 19.6875 + adjust;
|
||||
|
||||
refdef.time = uis.realtime;
|
||||
|
||||
origin[0] = 300;
|
||||
origin[1] = 0;
|
||||
origin[2] = -32;
|
||||
|
||||
trap_R_ClearScene();
|
||||
|
||||
// add the model
|
||||
|
||||
memset( &ent, 0, sizeof(ent) );
|
||||
|
||||
adjust = 5.0 * sin( (float)uis.realtime / 5000 );
|
||||
VectorSet( angles, 0, 180 + adjust, 0 );
|
||||
AnglesToAxis( angles, ent.axis );
|
||||
ent.hModel = s_main.bannerModel;
|
||||
VectorCopy( origin, ent.origin );
|
||||
VectorCopy( origin, ent.lightingOrigin );
|
||||
ent.renderfx = RF_LIGHTING_ORIGIN | RF_NOSHADOW;
|
||||
VectorCopy( ent.origin, ent.oldorigin );
|
||||
|
||||
trap_R_AddRefEntityToScene( &ent );
|
||||
|
||||
trap_R_RenderScene( &refdef );
|
||||
|
||||
if (strlen(s_errorMessage.errorMessage))
|
||||
{
|
||||
UI_DrawProportionalString_AutoWrapped( 320, 192, 600, 20, s_errorMessage.errorMessage, UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );
|
||||
}
|
||||
else
|
||||
{
|
||||
// standard menu drawing
|
||||
Menu_Draw( &s_main.menu );
|
||||
}
|
||||
|
||||
if (uis.demoversion) {
|
||||
UI_DrawProportionalString( 320, 372, "DEMO FOR MATURE AUDIENCES DEMO", UI_CENTER|UI_SMALLFONT, color );
|
||||
UI_DrawString( 320, 400, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
|
||||
} else {
|
||||
UI_DrawString( 320, 450, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_TeamArenaExists
|
||||
===============
|
||||
*/
|
||||
static qboolean UI_TeamArenaExists( void ) {
|
||||
int numdirs;
|
||||
char dirlist[2048];
|
||||
char *dirptr;
|
||||
char *descptr;
|
||||
int i;
|
||||
int dirlen;
|
||||
|
||||
numdirs = trap_FS_GetFileList( "$modlist", "", dirlist, sizeof(dirlist) );
|
||||
dirptr = dirlist;
|
||||
for( i = 0; i < numdirs; i++ ) {
|
||||
dirlen = strlen( dirptr ) + 1;
|
||||
descptr = dirptr + dirlen;
|
||||
if (Q_stricmp(dirptr, "missionpack") == 0) {
|
||||
return qtrue;
|
||||
}
|
||||
dirptr += dirlen + strlen(descptr) + 1;
|
||||
}
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_MainMenu
|
||||
|
||||
The main menu only comes up when not in a game,
|
||||
so make sure that the attract loop server is down
|
||||
and that local cinematics are killed
|
||||
===============
|
||||
*/
|
||||
void UI_MainMenu( void ) {
|
||||
int y;
|
||||
qboolean teamArena = qfalse;
|
||||
int style = UI_CENTER | UI_DROPSHADOW;
|
||||
|
||||
trap_Cvar_Set( "sv_killserver", "1" );
|
||||
|
||||
if( !uis.demoversion && !ui_cdkeychecked.integer ) {
|
||||
char key[17];
|
||||
|
||||
trap_GetCDKey( key, sizeof(key) );
|
||||
if( trap_VerifyCDKey( key, NULL ) == qfalse ) {
|
||||
UI_CDKeyMenu();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
memset( &s_main, 0 ,sizeof(mainmenu_t) );
|
||||
memset( &s_errorMessage, 0 ,sizeof(errorMessage_t) );
|
||||
|
||||
// com_errorMessage would need that too
|
||||
MainMenu_Cache();
|
||||
|
||||
trap_Cvar_VariableStringBuffer( "com_errorMessage", s_errorMessage.errorMessage, sizeof(s_errorMessage.errorMessage) );
|
||||
if (strlen(s_errorMessage.errorMessage))
|
||||
{
|
||||
s_errorMessage.menu.draw = Main_MenuDraw;
|
||||
s_errorMessage.menu.key = ErrorMessage_Key;
|
||||
s_errorMessage.menu.fullscreen = qtrue;
|
||||
s_errorMessage.menu.wrapAround = qtrue;
|
||||
s_errorMessage.menu.showlogo = qtrue;
|
||||
|
||||
trap_Key_SetCatcher( KEYCATCH_UI );
|
||||
uis.menusp = 0;
|
||||
UI_PushMenu ( &s_errorMessage.menu );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
s_main.menu.draw = Main_MenuDraw;
|
||||
s_main.menu.fullscreen = qtrue;
|
||||
s_main.menu.wrapAround = qtrue;
|
||||
s_main.menu.showlogo = qtrue;
|
||||
|
||||
y = 134;
|
||||
s_main.singleplayer.generic.type = MTYPE_PTEXT;
|
||||
s_main.singleplayer.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_main.singleplayer.generic.x = 320;
|
||||
s_main.singleplayer.generic.y = y;
|
||||
s_main.singleplayer.generic.id = ID_SINGLEPLAYER;
|
||||
s_main.singleplayer.generic.callback = Main_MenuEvent;
|
||||
s_main.singleplayer.string = "SINGLE PLAYER";
|
||||
s_main.singleplayer.color = color_red;
|
||||
s_main.singleplayer.style = style;
|
||||
|
||||
y += MAIN_MENU_VERTICAL_SPACING;
|
||||
s_main.multiplayer.generic.type = MTYPE_PTEXT;
|
||||
s_main.multiplayer.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_main.multiplayer.generic.x = 320;
|
||||
s_main.multiplayer.generic.y = y;
|
||||
s_main.multiplayer.generic.id = ID_MULTIPLAYER;
|
||||
s_main.multiplayer.generic.callback = Main_MenuEvent;
|
||||
s_main.multiplayer.string = "MULTIPLAYER";
|
||||
s_main.multiplayer.color = color_red;
|
||||
s_main.multiplayer.style = style;
|
||||
|
||||
y += MAIN_MENU_VERTICAL_SPACING;
|
||||
s_main.setup.generic.type = MTYPE_PTEXT;
|
||||
s_main.setup.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_main.setup.generic.x = 320;
|
||||
s_main.setup.generic.y = y;
|
||||
s_main.setup.generic.id = ID_SETUP;
|
||||
s_main.setup.generic.callback = Main_MenuEvent;
|
||||
s_main.setup.string = "SETUP";
|
||||
s_main.setup.color = color_red;
|
||||
s_main.setup.style = style;
|
||||
|
||||
y += MAIN_MENU_VERTICAL_SPACING;
|
||||
s_main.demos.generic.type = MTYPE_PTEXT;
|
||||
s_main.demos.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_main.demos.generic.x = 320;
|
||||
s_main.demos.generic.y = y;
|
||||
s_main.demos.generic.id = ID_DEMOS;
|
||||
s_main.demos.generic.callback = Main_MenuEvent;
|
||||
s_main.demos.string = "DEMOS";
|
||||
s_main.demos.color = color_red;
|
||||
s_main.demos.style = style;
|
||||
|
||||
y += MAIN_MENU_VERTICAL_SPACING;
|
||||
s_main.cinematics.generic.type = MTYPE_PTEXT;
|
||||
s_main.cinematics.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_main.cinematics.generic.x = 320;
|
||||
s_main.cinematics.generic.y = y;
|
||||
s_main.cinematics.generic.id = ID_CINEMATICS;
|
||||
s_main.cinematics.generic.callback = Main_MenuEvent;
|
||||
s_main.cinematics.string = "CINEMATICS";
|
||||
s_main.cinematics.color = color_red;
|
||||
s_main.cinematics.style = style;
|
||||
|
||||
if (UI_TeamArenaExists()) {
|
||||
teamArena = qtrue;
|
||||
y += MAIN_MENU_VERTICAL_SPACING;
|
||||
s_main.teamArena.generic.type = MTYPE_PTEXT;
|
||||
s_main.teamArena.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_main.teamArena.generic.x = 320;
|
||||
s_main.teamArena.generic.y = y;
|
||||
s_main.teamArena.generic.id = ID_TEAMARENA;
|
||||
s_main.teamArena.generic.callback = Main_MenuEvent;
|
||||
s_main.teamArena.string = "TEAM ARENA";
|
||||
s_main.teamArena.color = color_red;
|
||||
s_main.teamArena.style = style;
|
||||
}
|
||||
|
||||
y += MAIN_MENU_VERTICAL_SPACING;
|
||||
s_main.mods.generic.type = MTYPE_PTEXT;
|
||||
s_main.mods.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_main.mods.generic.x = 320;
|
||||
s_main.mods.generic.y = y;
|
||||
s_main.mods.generic.id = ID_MODS;
|
||||
s_main.mods.generic.callback = Main_MenuEvent;
|
||||
s_main.mods.string = "MODS";
|
||||
s_main.mods.color = color_red;
|
||||
s_main.mods.style = style;
|
||||
|
||||
y += MAIN_MENU_VERTICAL_SPACING;
|
||||
s_main.exit.generic.type = MTYPE_PTEXT;
|
||||
s_main.exit.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_main.exit.generic.x = 320;
|
||||
s_main.exit.generic.y = y;
|
||||
s_main.exit.generic.id = ID_EXIT;
|
||||
s_main.exit.generic.callback = Main_MenuEvent;
|
||||
s_main.exit.string = "EXIT";
|
||||
s_main.exit.color = color_red;
|
||||
s_main.exit.style = style;
|
||||
|
||||
Menu_AddItem( &s_main.menu, &s_main.singleplayer );
|
||||
Menu_AddItem( &s_main.menu, &s_main.multiplayer );
|
||||
Menu_AddItem( &s_main.menu, &s_main.setup );
|
||||
Menu_AddItem( &s_main.menu, &s_main.demos );
|
||||
Menu_AddItem( &s_main.menu, &s_main.cinematics );
|
||||
if (teamArena) {
|
||||
Menu_AddItem( &s_main.menu, &s_main.teamArena );
|
||||
}
|
||||
Menu_AddItem( &s_main.menu, &s_main.mods );
|
||||
Menu_AddItem( &s_main.menu, &s_main.exit );
|
||||
|
||||
trap_Key_SetCatcher( KEYCATCH_UI );
|
||||
uis.menusp = 0;
|
||||
UI_PushMenu ( &s_main.menu );
|
||||
|
||||
}
|
||||
419
code/q3_ui/.svn/text-base/ui_mfield.c.svn-base
Executable file
419
code/q3_ui/.svn/text-base/ui_mfield.c.svn-base
Executable file
@@ -0,0 +1,419 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
#include "ui_local.h"
|
||||
|
||||
/*
|
||||
===================
|
||||
MField_Draw
|
||||
|
||||
Handles horizontal scrolling and cursor blinking
|
||||
x, y, are in pixels
|
||||
===================
|
||||
*/
|
||||
void MField_Draw( mfield_t *edit, int x, int y, int style, vec4_t color ) {
|
||||
int len;
|
||||
int charw;
|
||||
int drawLen;
|
||||
int prestep;
|
||||
int cursorChar;
|
||||
char str[MAX_STRING_CHARS];
|
||||
|
||||
drawLen = edit->widthInChars;
|
||||
len = strlen( edit->buffer ) + 1;
|
||||
|
||||
// guarantee that cursor will be visible
|
||||
if ( len <= drawLen ) {
|
||||
prestep = 0;
|
||||
} else {
|
||||
if ( edit->scroll + drawLen > len ) {
|
||||
edit->scroll = len - drawLen;
|
||||
if ( edit->scroll < 0 ) {
|
||||
edit->scroll = 0;
|
||||
}
|
||||
}
|
||||
prestep = edit->scroll;
|
||||
}
|
||||
|
||||
if ( prestep + drawLen > len ) {
|
||||
drawLen = len - prestep;
|
||||
}
|
||||
|
||||
// extract <drawLen> characters from the field at <prestep>
|
||||
if ( drawLen >= MAX_STRING_CHARS ) {
|
||||
trap_Error( "drawLen >= MAX_STRING_CHARS" );
|
||||
}
|
||||
memcpy( str, edit->buffer + prestep, drawLen );
|
||||
str[ drawLen ] = 0;
|
||||
|
||||
UI_DrawString( x, y, str, style, color );
|
||||
|
||||
// draw the cursor
|
||||
if (!(style & UI_PULSE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( trap_Key_GetOverstrikeMode() ) {
|
||||
cursorChar = 11;
|
||||
} else {
|
||||
cursorChar = 10;
|
||||
}
|
||||
|
||||
style &= ~UI_PULSE;
|
||||
style |= UI_BLINK;
|
||||
|
||||
if (style & UI_SMALLFONT)
|
||||
{
|
||||
charw = SMALLCHAR_WIDTH;
|
||||
}
|
||||
else if (style & UI_GIANTFONT)
|
||||
{
|
||||
charw = GIANTCHAR_WIDTH;
|
||||
}
|
||||
else
|
||||
{
|
||||
charw = BIGCHAR_WIDTH;
|
||||
}
|
||||
|
||||
if (style & UI_CENTER)
|
||||
{
|
||||
len = strlen(str);
|
||||
x = x - len*charw/2;
|
||||
}
|
||||
else if (style & UI_RIGHT)
|
||||
{
|
||||
len = strlen(str);
|
||||
x = x - len*charw;
|
||||
}
|
||||
|
||||
UI_DrawChar( x + ( edit->cursor - prestep ) * charw, y, cursorChar, style & ~(UI_CENTER|UI_RIGHT), color );
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
MField_Paste
|
||||
================
|
||||
*/
|
||||
void MField_Paste( mfield_t *edit ) {
|
||||
char pasteBuffer[64];
|
||||
int pasteLen, i;
|
||||
|
||||
trap_GetClipboardData( pasteBuffer, 64 );
|
||||
|
||||
// send as if typed, so insert / overstrike works properly
|
||||
pasteLen = strlen( pasteBuffer );
|
||||
for ( i = 0 ; i < pasteLen ; i++ ) {
|
||||
MField_CharEvent( edit, pasteBuffer[i] );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
MField_KeyDownEvent
|
||||
|
||||
Performs the basic line editing functions for the console,
|
||||
in-game talk, and menu fields
|
||||
|
||||
Key events are used for non-printable characters, others are gotten from char events.
|
||||
=================
|
||||
*/
|
||||
void MField_KeyDownEvent( mfield_t *edit, int key ) {
|
||||
int len;
|
||||
|
||||
// shift-insert is paste
|
||||
if ( ( ( key == K_INS ) || ( key == K_KP_INS ) ) && trap_Key_IsDown( K_SHIFT ) ) {
|
||||
MField_Paste( edit );
|
||||
return;
|
||||
}
|
||||
|
||||
len = strlen( edit->buffer );
|
||||
|
||||
if ( key == K_DEL || key == K_KP_DEL ) {
|
||||
if ( edit->cursor < len ) {
|
||||
memmove( edit->buffer + edit->cursor,
|
||||
edit->buffer + edit->cursor + 1, len - edit->cursor );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ( key == K_RIGHTARROW || key == K_KP_RIGHTARROW )
|
||||
{
|
||||
if ( edit->cursor < len ) {
|
||||
edit->cursor++;
|
||||
}
|
||||
if ( edit->cursor >= edit->scroll + edit->widthInChars && edit->cursor <= len )
|
||||
{
|
||||
edit->scroll++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ( key == K_LEFTARROW || key == K_KP_LEFTARROW )
|
||||
{
|
||||
if ( edit->cursor > 0 ) {
|
||||
edit->cursor--;
|
||||
}
|
||||
if ( edit->cursor < edit->scroll )
|
||||
{
|
||||
edit->scroll--;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ( key == K_HOME || key == K_KP_HOME || ( tolower(key) == 'a' && trap_Key_IsDown( K_CTRL ) ) ) {
|
||||
edit->cursor = 0;
|
||||
edit->scroll = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( key == K_END || key == K_KP_END || ( tolower(key) == 'e' && trap_Key_IsDown( K_CTRL ) ) ) {
|
||||
edit->cursor = len;
|
||||
edit->scroll = len - edit->widthInChars + 1;
|
||||
if (edit->scroll < 0)
|
||||
edit->scroll = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( key == K_INS || key == K_KP_INS ) {
|
||||
trap_Key_SetOverstrikeMode( !trap_Key_GetOverstrikeMode() );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
MField_CharEvent
|
||||
==================
|
||||
*/
|
||||
void MField_CharEvent( mfield_t *edit, int ch ) {
|
||||
int len;
|
||||
|
||||
if ( ch == 'v' - 'a' + 1 ) { // ctrl-v is paste
|
||||
MField_Paste( edit );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ch == 'c' - 'a' + 1 ) { // ctrl-c clears the field
|
||||
MField_Clear( edit );
|
||||
return;
|
||||
}
|
||||
|
||||
len = strlen( edit->buffer );
|
||||
|
||||
if ( ch == 'h' - 'a' + 1 ) { // ctrl-h is backspace
|
||||
if ( edit->cursor > 0 ) {
|
||||
memmove( edit->buffer + edit->cursor - 1,
|
||||
edit->buffer + edit->cursor, len + 1 - edit->cursor );
|
||||
edit->cursor--;
|
||||
if ( edit->cursor < edit->scroll )
|
||||
{
|
||||
edit->scroll--;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ch == 'a' - 'a' + 1 ) { // ctrl-a is home
|
||||
edit->cursor = 0;
|
||||
edit->scroll = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ch == 'e' - 'a' + 1 ) { // ctrl-e is end
|
||||
edit->cursor = len;
|
||||
edit->scroll = edit->cursor - edit->widthInChars + 1;
|
||||
if (edit->scroll < 0)
|
||||
edit->scroll = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// ignore any other non printable chars
|
||||
//
|
||||
if ( ch < 32 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !trap_Key_GetOverstrikeMode() ) {
|
||||
if ((edit->cursor == MAX_EDIT_LINE - 1) || (edit->maxchars && edit->cursor >= edit->maxchars))
|
||||
return;
|
||||
} else {
|
||||
// insert mode
|
||||
if (( len == MAX_EDIT_LINE - 1 ) || (edit->maxchars && len >= edit->maxchars))
|
||||
return;
|
||||
memmove( edit->buffer + edit->cursor + 1, edit->buffer + edit->cursor, len + 1 - edit->cursor );
|
||||
}
|
||||
|
||||
edit->buffer[edit->cursor] = ch;
|
||||
if (!edit->maxchars || edit->cursor < edit->maxchars-1)
|
||||
edit->cursor++;
|
||||
|
||||
if ( edit->cursor >= edit->widthInChars )
|
||||
{
|
||||
edit->scroll++;
|
||||
}
|
||||
|
||||
if ( edit->cursor == len + 1) {
|
||||
edit->buffer[edit->cursor] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
MField_Clear
|
||||
==================
|
||||
*/
|
||||
void MField_Clear( mfield_t *edit ) {
|
||||
edit->buffer[0] = 0;
|
||||
edit->cursor = 0;
|
||||
edit->scroll = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
MenuField_Init
|
||||
==================
|
||||
*/
|
||||
void MenuField_Init( menufield_s* m ) {
|
||||
int l;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
MField_Clear( &m->field );
|
||||
|
||||
if (m->generic.flags & QMF_SMALLFONT)
|
||||
{
|
||||
w = SMALLCHAR_WIDTH;
|
||||
h = SMALLCHAR_HEIGHT;
|
||||
}
|
||||
else
|
||||
{
|
||||
w = BIGCHAR_WIDTH;
|
||||
h = BIGCHAR_HEIGHT;
|
||||
}
|
||||
|
||||
if (m->generic.name) {
|
||||
l = (strlen( m->generic.name )+1) * w;
|
||||
}
|
||||
else {
|
||||
l = 0;
|
||||
}
|
||||
|
||||
m->generic.left = m->generic.x - l;
|
||||
m->generic.top = m->generic.y;
|
||||
m->generic.right = m->generic.x + w + m->field.widthInChars*w;
|
||||
m->generic.bottom = m->generic.y + h;
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
MenuField_Draw
|
||||
==================
|
||||
*/
|
||||
void MenuField_Draw( menufield_s *f )
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int w;
|
||||
int h;
|
||||
int style;
|
||||
qboolean focus;
|
||||
float *color;
|
||||
|
||||
x = f->generic.x;
|
||||
y = f->generic.y;
|
||||
|
||||
if (f->generic.flags & QMF_SMALLFONT)
|
||||
{
|
||||
w = SMALLCHAR_WIDTH;
|
||||
h = SMALLCHAR_HEIGHT;
|
||||
style = UI_SMALLFONT;
|
||||
}
|
||||
else
|
||||
{
|
||||
w = BIGCHAR_WIDTH;
|
||||
h = BIGCHAR_HEIGHT;
|
||||
style = UI_BIGFONT;
|
||||
}
|
||||
|
||||
if (Menu_ItemAtCursor( f->generic.parent ) == f) {
|
||||
focus = qtrue;
|
||||
style |= UI_PULSE;
|
||||
}
|
||||
else {
|
||||
focus = qfalse;
|
||||
}
|
||||
|
||||
if (f->generic.flags & QMF_GRAYED)
|
||||
color = text_color_disabled;
|
||||
else if (focus)
|
||||
color = text_color_highlight;
|
||||
else
|
||||
color = text_color_normal;
|
||||
|
||||
if ( focus )
|
||||
{
|
||||
// draw cursor
|
||||
UI_FillRect( f->generic.left, f->generic.top, f->generic.right-f->generic.left+1, f->generic.bottom-f->generic.top+1, listbar_color );
|
||||
UI_DrawChar( x, y, 13, UI_CENTER|UI_BLINK|style, color);
|
||||
}
|
||||
|
||||
if ( f->generic.name ) {
|
||||
UI_DrawString( x - w, y, f->generic.name, style|UI_RIGHT, color );
|
||||
}
|
||||
|
||||
MField_Draw( &f->field, x + w, y, style, color );
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
MenuField_Key
|
||||
==================
|
||||
*/
|
||||
sfxHandle_t MenuField_Key( menufield_s* m, int* key )
|
||||
{
|
||||
int keycode;
|
||||
|
||||
keycode = *key;
|
||||
|
||||
switch ( keycode )
|
||||
{
|
||||
case K_KP_ENTER:
|
||||
case K_ENTER:
|
||||
case K_JOY1:
|
||||
case K_JOY2:
|
||||
case K_JOY3:
|
||||
case K_JOY4:
|
||||
// have enter go to next cursor point
|
||||
*key = K_TAB;
|
||||
break;
|
||||
|
||||
case K_TAB:
|
||||
case K_KP_DOWNARROW:
|
||||
case K_DOWNARROW:
|
||||
case K_KP_UPARROW:
|
||||
case K_UPARROW:
|
||||
break;
|
||||
|
||||
default:
|
||||
if ( keycode & K_CHAR_FLAG )
|
||||
{
|
||||
keycode &= ~K_CHAR_FLAG;
|
||||
|
||||
if ((m->generic.flags & QMF_UPPERCASE) && Q_islower( keycode ))
|
||||
keycode -= 'a' - 'A';
|
||||
else if ((m->generic.flags & QMF_LOWERCASE) && Q_isupper( keycode ))
|
||||
keycode -= 'A' - 'a';
|
||||
else if ((m->generic.flags & QMF_NUMBERSONLY) && Q_isalpha( keycode ))
|
||||
return (menu_buzz_sound);
|
||||
|
||||
MField_CharEvent( &m->field, keycode);
|
||||
}
|
||||
else
|
||||
MField_KeyDownEvent( &m->field, keycode );
|
||||
break;
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
263
code/q3_ui/.svn/text-base/ui_mods.c.svn-base
Executable file
263
code/q3_ui/.svn/text-base/ui_mods.c.svn-base
Executable file
@@ -0,0 +1,263 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
#include "ui_local.h"
|
||||
|
||||
#define ART_BACK0 "menu/art/back_0"
|
||||
#define ART_BACK1 "menu/art/back_1"
|
||||
#define ART_FIGHT0 "menu/art/load_0"
|
||||
#define ART_FIGHT1 "menu/art/load_1"
|
||||
#define ART_FRAMEL "menu/art/frame2_l"
|
||||
#define ART_FRAMER "menu/art/frame1_r"
|
||||
|
||||
#define MAX_MODS 64
|
||||
#define NAMEBUFSIZE ( MAX_MODS * 48 )
|
||||
#define GAMEBUFSIZE ( MAX_MODS * 16 )
|
||||
|
||||
#define ID_BACK 10
|
||||
#define ID_GO 11
|
||||
#define ID_LIST 12
|
||||
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
|
||||
menutext_s banner;
|
||||
menubitmap_s framel;
|
||||
menubitmap_s framer;
|
||||
|
||||
menulist_s list;
|
||||
|
||||
menubitmap_s back;
|
||||
menubitmap_s go;
|
||||
|
||||
char description[NAMEBUFSIZE];
|
||||
char fs_game[GAMEBUFSIZE];
|
||||
|
||||
char *descriptionPtr;
|
||||
char *fs_gamePtr;
|
||||
|
||||
char *descriptionList[MAX_MODS];
|
||||
char *fs_gameList[MAX_MODS];
|
||||
} mods_t;
|
||||
|
||||
static mods_t s_mods;
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_Mods_MenuEvent
|
||||
===============
|
||||
*/
|
||||
static void UI_Mods_MenuEvent( void *ptr, int event ) {
|
||||
if( event != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch ( ((menucommon_s*)ptr)->id ) {
|
||||
case ID_GO:
|
||||
trap_Cvar_Set( "fs_game", s_mods.fs_gameList[s_mods.list.curvalue] );
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart;" );
|
||||
UI_PopMenu();
|
||||
break;
|
||||
|
||||
case ID_BACK:
|
||||
UI_PopMenu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_Mods_ParseInfos
|
||||
===============
|
||||
*/
|
||||
static void UI_Mods_ParseInfos( char *modDir, char *modDesc ) {
|
||||
s_mods.fs_gameList[s_mods.list.numitems] = s_mods.fs_gamePtr;
|
||||
Q_strncpyz( s_mods.fs_gamePtr, modDir, 16 );
|
||||
|
||||
s_mods.descriptionList[s_mods.list.numitems] = s_mods.descriptionPtr;
|
||||
Q_strncpyz( s_mods.descriptionPtr, modDesc, 48 );
|
||||
|
||||
s_mods.list.itemnames[s_mods.list.numitems] = s_mods.descriptionPtr;
|
||||
s_mods.descriptionPtr += strlen( s_mods.descriptionPtr ) + 1;
|
||||
s_mods.fs_gamePtr += strlen( s_mods.fs_gamePtr ) + 1;
|
||||
s_mods.list.numitems++;
|
||||
}
|
||||
|
||||
|
||||
#if 0 // bk001204 - unused
|
||||
/*
|
||||
===============
|
||||
UI_Mods_LoadModsFromFile
|
||||
===============
|
||||
*/
|
||||
static void UI_Mods_LoadModsFromFile( char *filename ) {
|
||||
int len;
|
||||
fileHandle_t f;
|
||||
char buf[1024];
|
||||
|
||||
len = trap_FS_FOpenFile( filename, &f, FS_READ );
|
||||
if ( !f ) {
|
||||
trap_Print( va( S_COLOR_RED "file not found: %s\n", filename ) );
|
||||
return;
|
||||
}
|
||||
if ( len >= sizeof(buf) ) {
|
||||
trap_Print( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i", filename, len, sizeof(buf) ) );
|
||||
trap_FS_FCloseFile( f );
|
||||
return;
|
||||
}
|
||||
|
||||
trap_FS_Read( buf, len, f );
|
||||
buf[len] = 0;
|
||||
trap_FS_FCloseFile( f );
|
||||
|
||||
len = strlen( filename );
|
||||
if( !Q_stricmp(filename + len - 4,".mod") ) {
|
||||
filename[len-4] = '\0';
|
||||
}
|
||||
|
||||
UI_Mods_ParseInfos( filename, buf );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_Mods_LoadMods
|
||||
===============
|
||||
*/
|
||||
static void UI_Mods_LoadMods( void ) {
|
||||
int numdirs;
|
||||
char dirlist[2048];
|
||||
char *dirptr;
|
||||
char *descptr;
|
||||
int i;
|
||||
int dirlen;
|
||||
|
||||
s_mods.list.itemnames = (const char **)s_mods.descriptionList;
|
||||
s_mods.descriptionPtr = s_mods.description;
|
||||
s_mods.fs_gamePtr = s_mods.fs_game;
|
||||
|
||||
// always start off with baseq3
|
||||
s_mods.list.numitems = 1;
|
||||
s_mods.list.itemnames[0] = s_mods.descriptionList[0] = "Quake III Arena";
|
||||
s_mods.fs_gameList[0] = "";
|
||||
|
||||
numdirs = trap_FS_GetFileList( "$modlist", "", dirlist, sizeof(dirlist) );
|
||||
dirptr = dirlist;
|
||||
for( i = 0; i < numdirs; i++ ) {
|
||||
dirlen = strlen( dirptr ) + 1;
|
||||
descptr = dirptr + dirlen;
|
||||
UI_Mods_ParseInfos( dirptr, descptr);
|
||||
dirptr += dirlen + strlen(descptr) + 1;
|
||||
}
|
||||
|
||||
trap_Print( va( "%i mods parsed\n", s_mods.list.numitems ) );
|
||||
if (s_mods.list.numitems > MAX_MODS) {
|
||||
s_mods.list.numitems = MAX_MODS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_Mods_MenuInit
|
||||
===============
|
||||
*/
|
||||
static void UI_Mods_MenuInit( void ) {
|
||||
UI_ModsMenu_Cache();
|
||||
|
||||
memset( &s_mods, 0 ,sizeof(mods_t) );
|
||||
s_mods.menu.wrapAround = qtrue;
|
||||
s_mods.menu.fullscreen = qtrue;
|
||||
|
||||
s_mods.banner.generic.type = MTYPE_BTEXT;
|
||||
s_mods.banner.generic.x = 320;
|
||||
s_mods.banner.generic.y = 16;
|
||||
s_mods.banner.string = "MODS";
|
||||
s_mods.banner.color = color_white;
|
||||
s_mods.banner.style = UI_CENTER;
|
||||
|
||||
s_mods.framel.generic.type = MTYPE_BITMAP;
|
||||
s_mods.framel.generic.name = ART_FRAMEL;
|
||||
s_mods.framel.generic.flags = QMF_INACTIVE;
|
||||
s_mods.framel.generic.x = 0;
|
||||
s_mods.framel.generic.y = 78;
|
||||
s_mods.framel.width = 256;
|
||||
s_mods.framel.height = 329;
|
||||
|
||||
s_mods.framer.generic.type = MTYPE_BITMAP;
|
||||
s_mods.framer.generic.name = ART_FRAMER;
|
||||
s_mods.framer.generic.flags = QMF_INACTIVE;
|
||||
s_mods.framer.generic.x = 376;
|
||||
s_mods.framer.generic.y = 76;
|
||||
s_mods.framer.width = 256;
|
||||
s_mods.framer.height = 334;
|
||||
|
||||
s_mods.back.generic.type = MTYPE_BITMAP;
|
||||
s_mods.back.generic.name = ART_BACK0;
|
||||
s_mods.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_mods.back.generic.id = ID_BACK;
|
||||
s_mods.back.generic.callback = UI_Mods_MenuEvent;
|
||||
s_mods.back.generic.x = 0;
|
||||
s_mods.back.generic.y = 480-64;
|
||||
s_mods.back.width = 128;
|
||||
s_mods.back.height = 64;
|
||||
s_mods.back.focuspic = ART_BACK1;
|
||||
|
||||
s_mods.go.generic.type = MTYPE_BITMAP;
|
||||
s_mods.go.generic.name = ART_FIGHT0;
|
||||
s_mods.go.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_mods.go.generic.id = ID_GO;
|
||||
s_mods.go.generic.callback = UI_Mods_MenuEvent;
|
||||
s_mods.go.generic.x = 640;
|
||||
s_mods.go.generic.y = 480-64;
|
||||
s_mods.go.width = 128;
|
||||
s_mods.go.height = 64;
|
||||
s_mods.go.focuspic = ART_FIGHT1;
|
||||
|
||||
// scan for mods
|
||||
s_mods.list.generic.type = MTYPE_SCROLLLIST;
|
||||
s_mods.list.generic.flags = QMF_PULSEIFFOCUS|QMF_CENTER_JUSTIFY;
|
||||
s_mods.list.generic.callback = UI_Mods_MenuEvent;
|
||||
s_mods.list.generic.id = ID_LIST;
|
||||
s_mods.list.generic.x = 320;
|
||||
s_mods.list.generic.y = 130;
|
||||
s_mods.list.width = 48;
|
||||
s_mods.list.height = 14;
|
||||
|
||||
UI_Mods_LoadMods();
|
||||
|
||||
Menu_AddItem( &s_mods.menu, &s_mods.banner );
|
||||
Menu_AddItem( &s_mods.menu, &s_mods.framel );
|
||||
Menu_AddItem( &s_mods.menu, &s_mods.framer );
|
||||
Menu_AddItem( &s_mods.menu, &s_mods.list );
|
||||
Menu_AddItem( &s_mods.menu, &s_mods.back );
|
||||
Menu_AddItem( &s_mods.menu, &s_mods.go );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_Mods_Cache
|
||||
=================
|
||||
*/
|
||||
void UI_ModsMenu_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( ART_BACK0 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK1 );
|
||||
trap_R_RegisterShaderNoMip( ART_FIGHT0 );
|
||||
trap_R_RegisterShaderNoMip( ART_FIGHT1 );
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMEL );
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMER );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_ModsMenu
|
||||
===============
|
||||
*/
|
||||
void UI_ModsMenu( void ) {
|
||||
UI_Mods_MenuInit();
|
||||
UI_PushMenu( &s_mods.menu );
|
||||
}
|
||||
261
code/q3_ui/.svn/text-base/ui_network.c.svn-base
Executable file
261
code/q3_ui/.svn/text-base/ui_network.c.svn-base
Executable file
@@ -0,0 +1,261 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
/*
|
||||
=======================================================================
|
||||
|
||||
NETWORK OPTIONS MENU
|
||||
|
||||
=======================================================================
|
||||
*/
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define ART_FRAMEL "menu/art/frame2_l"
|
||||
#define ART_FRAMER "menu/art/frame1_r"
|
||||
#define ART_BACK0 "menu/art/back_0"
|
||||
#define ART_BACK1 "menu/art/back_1"
|
||||
|
||||
#define ID_GRAPHICS 10
|
||||
#define ID_DISPLAY 11
|
||||
#define ID_SOUND 12
|
||||
#define ID_NETWORK 13
|
||||
#define ID_RATE 14
|
||||
#define ID_BACK 15
|
||||
|
||||
|
||||
static const char *rate_items[] = {
|
||||
"<= 28.8K",
|
||||
"33.6K",
|
||||
"56K",
|
||||
"ISDN",
|
||||
"LAN/Cable/xDSL",
|
||||
0
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
|
||||
menutext_s banner;
|
||||
menubitmap_s framel;
|
||||
menubitmap_s framer;
|
||||
|
||||
menutext_s graphics;
|
||||
menutext_s display;
|
||||
menutext_s sound;
|
||||
menutext_s network;
|
||||
|
||||
menulist_s rate;
|
||||
|
||||
menubitmap_s back;
|
||||
} networkOptionsInfo_t;
|
||||
|
||||
static networkOptionsInfo_t networkOptionsInfo;
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_NetworkOptionsMenu_Event
|
||||
=================
|
||||
*/
|
||||
static void UI_NetworkOptionsMenu_Event( void* ptr, int event ) {
|
||||
if( event != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch( ((menucommon_s*)ptr)->id ) {
|
||||
case ID_GRAPHICS:
|
||||
UI_PopMenu();
|
||||
UI_GraphicsOptionsMenu();
|
||||
break;
|
||||
|
||||
case ID_DISPLAY:
|
||||
UI_PopMenu();
|
||||
UI_DisplayOptionsMenu();
|
||||
break;
|
||||
|
||||
case ID_SOUND:
|
||||
UI_PopMenu();
|
||||
UI_SoundOptionsMenu();
|
||||
break;
|
||||
|
||||
case ID_NETWORK:
|
||||
break;
|
||||
|
||||
case ID_RATE:
|
||||
if( networkOptionsInfo.rate.curvalue == 0 ) {
|
||||
trap_Cvar_SetValue( "rate", 2500 );
|
||||
}
|
||||
else if( networkOptionsInfo.rate.curvalue == 1 ) {
|
||||
trap_Cvar_SetValue( "rate", 3000 );
|
||||
}
|
||||
else if( networkOptionsInfo.rate.curvalue == 2 ) {
|
||||
trap_Cvar_SetValue( "rate", 4000 );
|
||||
}
|
||||
else if( networkOptionsInfo.rate.curvalue == 3 ) {
|
||||
trap_Cvar_SetValue( "rate", 5000 );
|
||||
}
|
||||
else if( networkOptionsInfo.rate.curvalue == 4 ) {
|
||||
trap_Cvar_SetValue( "rate", 25000 );
|
||||
}
|
||||
break;
|
||||
|
||||
case ID_BACK:
|
||||
UI_PopMenu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_NetworkOptionsMenu_Init
|
||||
===============
|
||||
*/
|
||||
static void UI_NetworkOptionsMenu_Init( void ) {
|
||||
int y;
|
||||
int rate;
|
||||
|
||||
memset( &networkOptionsInfo, 0, sizeof(networkOptionsInfo) );
|
||||
|
||||
UI_NetworkOptionsMenu_Cache();
|
||||
networkOptionsInfo.menu.wrapAround = qtrue;
|
||||
networkOptionsInfo.menu.fullscreen = qtrue;
|
||||
|
||||
networkOptionsInfo.banner.generic.type = MTYPE_BTEXT;
|
||||
networkOptionsInfo.banner.generic.flags = QMF_CENTER_JUSTIFY;
|
||||
networkOptionsInfo.banner.generic.x = 320;
|
||||
networkOptionsInfo.banner.generic.y = 16;
|
||||
networkOptionsInfo.banner.string = "SYSTEM SETUP";
|
||||
networkOptionsInfo.banner.color = color_white;
|
||||
networkOptionsInfo.banner.style = UI_CENTER;
|
||||
|
||||
networkOptionsInfo.framel.generic.type = MTYPE_BITMAP;
|
||||
networkOptionsInfo.framel.generic.name = ART_FRAMEL;
|
||||
networkOptionsInfo.framel.generic.flags = QMF_INACTIVE;
|
||||
networkOptionsInfo.framel.generic.x = 0;
|
||||
networkOptionsInfo.framel.generic.y = 78;
|
||||
networkOptionsInfo.framel.width = 256;
|
||||
networkOptionsInfo.framel.height = 329;
|
||||
|
||||
networkOptionsInfo.framer.generic.type = MTYPE_BITMAP;
|
||||
networkOptionsInfo.framer.generic.name = ART_FRAMER;
|
||||
networkOptionsInfo.framer.generic.flags = QMF_INACTIVE;
|
||||
networkOptionsInfo.framer.generic.x = 376;
|
||||
networkOptionsInfo.framer.generic.y = 76;
|
||||
networkOptionsInfo.framer.width = 256;
|
||||
networkOptionsInfo.framer.height = 334;
|
||||
|
||||
networkOptionsInfo.graphics.generic.type = MTYPE_PTEXT;
|
||||
networkOptionsInfo.graphics.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
networkOptionsInfo.graphics.generic.id = ID_GRAPHICS;
|
||||
networkOptionsInfo.graphics.generic.callback = UI_NetworkOptionsMenu_Event;
|
||||
networkOptionsInfo.graphics.generic.x = 216;
|
||||
networkOptionsInfo.graphics.generic.y = 240 - 2 * PROP_HEIGHT;
|
||||
networkOptionsInfo.graphics.string = "GRAPHICS";
|
||||
networkOptionsInfo.graphics.style = UI_RIGHT;
|
||||
networkOptionsInfo.graphics.color = color_red;
|
||||
|
||||
networkOptionsInfo.display.generic.type = MTYPE_PTEXT;
|
||||
networkOptionsInfo.display.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
networkOptionsInfo.display.generic.id = ID_DISPLAY;
|
||||
networkOptionsInfo.display.generic.callback = UI_NetworkOptionsMenu_Event;
|
||||
networkOptionsInfo.display.generic.x = 216;
|
||||
networkOptionsInfo.display.generic.y = 240 - PROP_HEIGHT;
|
||||
networkOptionsInfo.display.string = "DISPLAY";
|
||||
networkOptionsInfo.display.style = UI_RIGHT;
|
||||
networkOptionsInfo.display.color = color_red;
|
||||
|
||||
networkOptionsInfo.sound.generic.type = MTYPE_PTEXT;
|
||||
networkOptionsInfo.sound.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
networkOptionsInfo.sound.generic.id = ID_SOUND;
|
||||
networkOptionsInfo.sound.generic.callback = UI_NetworkOptionsMenu_Event;
|
||||
networkOptionsInfo.sound.generic.x = 216;
|
||||
networkOptionsInfo.sound.generic.y = 240;
|
||||
networkOptionsInfo.sound.string = "SOUND";
|
||||
networkOptionsInfo.sound.style = UI_RIGHT;
|
||||
networkOptionsInfo.sound.color = color_red;
|
||||
|
||||
networkOptionsInfo.network.generic.type = MTYPE_PTEXT;
|
||||
networkOptionsInfo.network.generic.flags = QMF_RIGHT_JUSTIFY;
|
||||
networkOptionsInfo.network.generic.id = ID_NETWORK;
|
||||
networkOptionsInfo.network.generic.callback = UI_NetworkOptionsMenu_Event;
|
||||
networkOptionsInfo.network.generic.x = 216;
|
||||
networkOptionsInfo.network.generic.y = 240 + PROP_HEIGHT;
|
||||
networkOptionsInfo.network.string = "NETWORK";
|
||||
networkOptionsInfo.network.style = UI_RIGHT;
|
||||
networkOptionsInfo.network.color = color_red;
|
||||
|
||||
y = 240 - 1 * (BIGCHAR_HEIGHT+2);
|
||||
networkOptionsInfo.rate.generic.type = MTYPE_SPINCONTROL;
|
||||
networkOptionsInfo.rate.generic.name = "Data Rate:";
|
||||
networkOptionsInfo.rate.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
networkOptionsInfo.rate.generic.callback = UI_NetworkOptionsMenu_Event;
|
||||
networkOptionsInfo.rate.generic.id = ID_RATE;
|
||||
networkOptionsInfo.rate.generic.x = 400;
|
||||
networkOptionsInfo.rate.generic.y = y;
|
||||
networkOptionsInfo.rate.itemnames = rate_items;
|
||||
|
||||
networkOptionsInfo.back.generic.type = MTYPE_BITMAP;
|
||||
networkOptionsInfo.back.generic.name = ART_BACK0;
|
||||
networkOptionsInfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
networkOptionsInfo.back.generic.callback = UI_NetworkOptionsMenu_Event;
|
||||
networkOptionsInfo.back.generic.id = ID_BACK;
|
||||
networkOptionsInfo.back.generic.x = 0;
|
||||
networkOptionsInfo.back.generic.y = 480-64;
|
||||
networkOptionsInfo.back.width = 128;
|
||||
networkOptionsInfo.back.height = 64;
|
||||
networkOptionsInfo.back.focuspic = ART_BACK1;
|
||||
|
||||
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.banner );
|
||||
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.framel );
|
||||
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.framer );
|
||||
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.graphics );
|
||||
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.display );
|
||||
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.sound );
|
||||
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.network );
|
||||
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.rate );
|
||||
Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.back );
|
||||
|
||||
rate = trap_Cvar_VariableValue( "rate" );
|
||||
if( rate <= 2500 ) {
|
||||
networkOptionsInfo.rate.curvalue = 0;
|
||||
}
|
||||
else if( rate <= 3000 ) {
|
||||
networkOptionsInfo.rate.curvalue = 1;
|
||||
}
|
||||
else if( rate <= 4000 ) {
|
||||
networkOptionsInfo.rate.curvalue = 2;
|
||||
}
|
||||
else if( rate <= 5000 ) {
|
||||
networkOptionsInfo.rate.curvalue = 3;
|
||||
}
|
||||
else {
|
||||
networkOptionsInfo.rate.curvalue = 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_NetworkOptionsMenu_Cache
|
||||
===============
|
||||
*/
|
||||
void UI_NetworkOptionsMenu_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMEL );
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMER );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK0 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK1 );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_NetworkOptionsMenu
|
||||
===============
|
||||
*/
|
||||
void UI_NetworkOptionsMenu( void ) {
|
||||
UI_NetworkOptionsMenu_Init();
|
||||
UI_PushMenu( &networkOptionsInfo.menu );
|
||||
Menu_SetCursorToItem( &networkOptionsInfo.menu, &networkOptionsInfo.network );
|
||||
}
|
||||
208
code/q3_ui/.svn/text-base/ui_options.c.svn-base
Executable file
208
code/q3_ui/.svn/text-base/ui_options.c.svn-base
Executable file
@@ -0,0 +1,208 @@
|
||||
/*
|
||||
=======================================================================
|
||||
|
||||
SYSTEM CONFIGURATION MENU
|
||||
|
||||
=======================================================================
|
||||
*/
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define ART_FRAMEL "menu/art/frame2_l"
|
||||
#define ART_FRAMER "menu/art/frame1_r"
|
||||
#define ART_BACK0 "menu/art/back_0"
|
||||
#define ART_BACK1 "menu/art/back_1"
|
||||
|
||||
#define ID_GRAPHICS 10
|
||||
#define ID_DISPLAY 11
|
||||
#define ID_SOUND 12
|
||||
#define ID_NETWORK 13
|
||||
#define ID_BACK 14
|
||||
|
||||
#define VERTICAL_SPACING 34
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
|
||||
menutext_s banner;
|
||||
menubitmap_s framel;
|
||||
menubitmap_s framer;
|
||||
|
||||
menutext_s graphics;
|
||||
menutext_s display;
|
||||
menutext_s sound;
|
||||
menutext_s network;
|
||||
menubitmap_s back;
|
||||
} optionsmenu_t;
|
||||
|
||||
static optionsmenu_t s_options;
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
Options_Event
|
||||
=================
|
||||
*/
|
||||
static void Options_Event( void* ptr, int event ) {
|
||||
if( event != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch( ((menucommon_s*)ptr)->id ) {
|
||||
case ID_GRAPHICS:
|
||||
UI_GraphicsOptionsMenu();
|
||||
break;
|
||||
|
||||
case ID_DISPLAY:
|
||||
UI_DisplayOptionsMenu();
|
||||
break;
|
||||
|
||||
case ID_SOUND:
|
||||
UI_SoundOptionsMenu();
|
||||
break;
|
||||
|
||||
case ID_NETWORK:
|
||||
UI_NetworkOptionsMenu();
|
||||
break;
|
||||
|
||||
case ID_BACK:
|
||||
UI_PopMenu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
SystemConfig_Cache
|
||||
===============
|
||||
*/
|
||||
void SystemConfig_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMEL );
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMER );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK0 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK1 );
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
Options_MenuInit
|
||||
===============
|
||||
*/
|
||||
void Options_MenuInit( void ) {
|
||||
int y;
|
||||
uiClientState_t cstate;
|
||||
|
||||
memset( &s_options, 0, sizeof(optionsmenu_t) );
|
||||
|
||||
SystemConfig_Cache();
|
||||
s_options.menu.wrapAround = qtrue;
|
||||
|
||||
trap_GetClientState( &cstate );
|
||||
if ( cstate.connState >= CA_CONNECTED ) {
|
||||
s_options.menu.fullscreen = qfalse;
|
||||
}
|
||||
else {
|
||||
s_options.menu.fullscreen = qtrue;
|
||||
}
|
||||
|
||||
s_options.banner.generic.type = MTYPE_BTEXT;
|
||||
s_options.banner.generic.flags = QMF_CENTER_JUSTIFY;
|
||||
s_options.banner.generic.x = 320;
|
||||
s_options.banner.generic.y = 16;
|
||||
s_options.banner.string = "SYSTEM SETUP";
|
||||
s_options.banner.color = color_white;
|
||||
s_options.banner.style = UI_CENTER;
|
||||
|
||||
s_options.framel.generic.type = MTYPE_BITMAP;
|
||||
s_options.framel.generic.name = ART_FRAMEL;
|
||||
s_options.framel.generic.flags = QMF_INACTIVE;
|
||||
s_options.framel.generic.x = 8;
|
||||
s_options.framel.generic.y = 76;
|
||||
s_options.framel.width = 256;
|
||||
s_options.framel.height = 334;
|
||||
|
||||
s_options.framer.generic.type = MTYPE_BITMAP;
|
||||
s_options.framer.generic.name = ART_FRAMER;
|
||||
s_options.framer.generic.flags = QMF_INACTIVE;
|
||||
s_options.framer.generic.x = 376;
|
||||
s_options.framer.generic.y = 76;
|
||||
s_options.framer.width = 256;
|
||||
s_options.framer.height = 334;
|
||||
|
||||
y = 168;
|
||||
s_options.graphics.generic.type = MTYPE_PTEXT;
|
||||
s_options.graphics.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_options.graphics.generic.callback = Options_Event;
|
||||
s_options.graphics.generic.id = ID_GRAPHICS;
|
||||
s_options.graphics.generic.x = 320;
|
||||
s_options.graphics.generic.y = y;
|
||||
s_options.graphics.string = "GRAPHICS";
|
||||
s_options.graphics.color = color_red;
|
||||
s_options.graphics.style = UI_CENTER;
|
||||
|
||||
y += VERTICAL_SPACING;
|
||||
s_options.display.generic.type = MTYPE_PTEXT;
|
||||
s_options.display.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_options.display.generic.callback = Options_Event;
|
||||
s_options.display.generic.id = ID_DISPLAY;
|
||||
s_options.display.generic.x = 320;
|
||||
s_options.display.generic.y = y;
|
||||
s_options.display.string = "DISPLAY";
|
||||
s_options.display.color = color_red;
|
||||
s_options.display.style = UI_CENTER;
|
||||
|
||||
y += VERTICAL_SPACING;
|
||||
s_options.sound.generic.type = MTYPE_PTEXT;
|
||||
s_options.sound.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_options.sound.generic.callback = Options_Event;
|
||||
s_options.sound.generic.id = ID_SOUND;
|
||||
s_options.sound.generic.x = 320;
|
||||
s_options.sound.generic.y = y;
|
||||
s_options.sound.string = "SOUND";
|
||||
s_options.sound.color = color_red;
|
||||
s_options.sound.style = UI_CENTER;
|
||||
|
||||
y += VERTICAL_SPACING;
|
||||
s_options.network.generic.type = MTYPE_PTEXT;
|
||||
s_options.network.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_options.network.generic.callback = Options_Event;
|
||||
s_options.network.generic.id = ID_NETWORK;
|
||||
s_options.network.generic.x = 320;
|
||||
s_options.network.generic.y = y;
|
||||
s_options.network.string = "NETWORK";
|
||||
s_options.network.color = color_red;
|
||||
s_options.network.style = UI_CENTER;
|
||||
|
||||
s_options.back.generic.type = MTYPE_BITMAP;
|
||||
s_options.back.generic.name = ART_BACK0;
|
||||
s_options.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_options.back.generic.callback = Options_Event;
|
||||
s_options.back.generic.id = ID_BACK;
|
||||
s_options.back.generic.x = 0;
|
||||
s_options.back.generic.y = 480-64;
|
||||
s_options.back.width = 128;
|
||||
s_options.back.height = 64;
|
||||
s_options.back.focuspic = ART_BACK1;
|
||||
|
||||
Menu_AddItem( &s_options.menu, ( void * ) &s_options.banner );
|
||||
Menu_AddItem( &s_options.menu, ( void * ) &s_options.framel );
|
||||
Menu_AddItem( &s_options.menu, ( void * ) &s_options.framer );
|
||||
Menu_AddItem( &s_options.menu, ( void * ) &s_options.graphics );
|
||||
Menu_AddItem( &s_options.menu, ( void * ) &s_options.display );
|
||||
Menu_AddItem( &s_options.menu, ( void * ) &s_options.sound );
|
||||
Menu_AddItem( &s_options.menu, ( void * ) &s_options.network );
|
||||
Menu_AddItem( &s_options.menu, ( void * ) &s_options.back );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_SystemConfigMenu
|
||||
===============
|
||||
*/
|
||||
void UI_SystemConfigMenu( void ) {
|
||||
Options_MenuInit();
|
||||
UI_PushMenu ( &s_options.menu );
|
||||
}
|
||||
711
code/q3_ui/.svn/text-base/ui_playermodel.c.svn-base
Executable file
711
code/q3_ui/.svn/text-base/ui_playermodel.c.svn-base
Executable file
@@ -0,0 +1,711 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
#include "ui_local.h"
|
||||
|
||||
#define MODEL_BACK0 "menu/art/back_0"
|
||||
#define MODEL_BACK1 "menu/art/back_1"
|
||||
#define MODEL_SELECT "menu/art/opponents_select"
|
||||
#define MODEL_SELECTED "menu/art/opponents_selected"
|
||||
#define MODEL_FRAMEL "menu/art/frame1_l"
|
||||
#define MODEL_FRAMER "menu/art/frame1_r"
|
||||
#define MODEL_PORTS "menu/art/player_models_ports"
|
||||
#define MODEL_ARROWS "menu/art/gs_arrows_0"
|
||||
#define MODEL_ARROWSL "menu/art/gs_arrows_l"
|
||||
#define MODEL_ARROWSR "menu/art/gs_arrows_r"
|
||||
|
||||
#define LOW_MEMORY (5 * 1024 * 1024)
|
||||
|
||||
static char* playermodel_artlist[] =
|
||||
{
|
||||
MODEL_BACK0,
|
||||
MODEL_BACK1,
|
||||
MODEL_SELECT,
|
||||
MODEL_SELECTED,
|
||||
MODEL_FRAMEL,
|
||||
MODEL_FRAMER,
|
||||
MODEL_PORTS,
|
||||
MODEL_ARROWS,
|
||||
MODEL_ARROWSL,
|
||||
MODEL_ARROWSR,
|
||||
NULL
|
||||
};
|
||||
|
||||
#define PLAYERGRID_COLS 4
|
||||
#define PLAYERGRID_ROWS 4
|
||||
#define MAX_MODELSPERPAGE (PLAYERGRID_ROWS*PLAYERGRID_COLS)
|
||||
|
||||
#define MAX_PLAYERMODELS 256
|
||||
|
||||
#define ID_PLAYERPIC0 0
|
||||
#define ID_PLAYERPIC1 1
|
||||
#define ID_PLAYERPIC2 2
|
||||
#define ID_PLAYERPIC3 3
|
||||
#define ID_PLAYERPIC4 4
|
||||
#define ID_PLAYERPIC5 5
|
||||
#define ID_PLAYERPIC6 6
|
||||
#define ID_PLAYERPIC7 7
|
||||
#define ID_PLAYERPIC8 8
|
||||
#define ID_PLAYERPIC9 9
|
||||
#define ID_PLAYERPIC10 10
|
||||
#define ID_PLAYERPIC11 11
|
||||
#define ID_PLAYERPIC12 12
|
||||
#define ID_PLAYERPIC13 13
|
||||
#define ID_PLAYERPIC14 14
|
||||
#define ID_PLAYERPIC15 15
|
||||
#define ID_PREVPAGE 100
|
||||
#define ID_NEXTPAGE 101
|
||||
#define ID_BACK 102
|
||||
|
||||
typedef struct
|
||||
{
|
||||
menuframework_s menu;
|
||||
menubitmap_s pics[MAX_MODELSPERPAGE];
|
||||
menubitmap_s picbuttons[MAX_MODELSPERPAGE];
|
||||
menubitmap_s framel;
|
||||
menubitmap_s framer;
|
||||
menubitmap_s ports;
|
||||
menutext_s banner;
|
||||
menubitmap_s back;
|
||||
menubitmap_s player;
|
||||
menubitmap_s arrows;
|
||||
menubitmap_s left;
|
||||
menubitmap_s right;
|
||||
menutext_s modelname;
|
||||
menutext_s skinname;
|
||||
menutext_s playername;
|
||||
playerInfo_t playerinfo;
|
||||
int nummodels;
|
||||
char modelnames[MAX_PLAYERMODELS][128];
|
||||
int modelpage;
|
||||
int numpages;
|
||||
char modelskin[64];
|
||||
int selectedmodel;
|
||||
} playermodel_t;
|
||||
|
||||
static playermodel_t s_playermodel;
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerModel_UpdateGrid
|
||||
=================
|
||||
*/
|
||||
static void PlayerModel_UpdateGrid( void )
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
|
||||
j = s_playermodel.modelpage * MAX_MODELSPERPAGE;
|
||||
for (i=0; i<PLAYERGRID_ROWS*PLAYERGRID_COLS; i++,j++)
|
||||
{
|
||||
if (j < s_playermodel.nummodels)
|
||||
{
|
||||
// model/skin portrait
|
||||
s_playermodel.pics[i].generic.name = s_playermodel.modelnames[j];
|
||||
s_playermodel.picbuttons[i].generic.flags &= ~QMF_INACTIVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// dead slot
|
||||
s_playermodel.pics[i].generic.name = NULL;
|
||||
s_playermodel.picbuttons[i].generic.flags |= QMF_INACTIVE;
|
||||
}
|
||||
|
||||
s_playermodel.pics[i].generic.flags &= ~QMF_HIGHLIGHT;
|
||||
s_playermodel.pics[i].shader = 0;
|
||||
s_playermodel.picbuttons[i].generic.flags |= QMF_PULSEIFFOCUS;
|
||||
}
|
||||
|
||||
if (s_playermodel.selectedmodel/MAX_MODELSPERPAGE == s_playermodel.modelpage)
|
||||
{
|
||||
// set selected model
|
||||
i = s_playermodel.selectedmodel % MAX_MODELSPERPAGE;
|
||||
|
||||
s_playermodel.pics[i].generic.flags |= QMF_HIGHLIGHT;
|
||||
s_playermodel.picbuttons[i].generic.flags &= ~QMF_PULSEIFFOCUS;
|
||||
}
|
||||
|
||||
if (s_playermodel.numpages > 1)
|
||||
{
|
||||
if (s_playermodel.modelpage > 0)
|
||||
s_playermodel.left.generic.flags &= ~QMF_INACTIVE;
|
||||
else
|
||||
s_playermodel.left.generic.flags |= QMF_INACTIVE;
|
||||
|
||||
if (s_playermodel.modelpage < s_playermodel.numpages-1)
|
||||
s_playermodel.right.generic.flags &= ~QMF_INACTIVE;
|
||||
else
|
||||
s_playermodel.right.generic.flags |= QMF_INACTIVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// hide left/right markers
|
||||
s_playermodel.left.generic.flags |= QMF_INACTIVE;
|
||||
s_playermodel.right.generic.flags |= QMF_INACTIVE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerModel_UpdateModel
|
||||
=================
|
||||
*/
|
||||
static void PlayerModel_UpdateModel( void )
|
||||
{
|
||||
vec3_t viewangles;
|
||||
vec3_t moveangles;
|
||||
|
||||
memset( &s_playermodel.playerinfo, 0, sizeof(playerInfo_t) );
|
||||
|
||||
viewangles[YAW] = 180 - 30;
|
||||
viewangles[PITCH] = 0;
|
||||
viewangles[ROLL] = 0;
|
||||
VectorClear( moveangles );
|
||||
|
||||
UI_PlayerInfo_SetModel( &s_playermodel.playerinfo, s_playermodel.modelskin );
|
||||
UI_PlayerInfo_SetInfo( &s_playermodel.playerinfo, LEGS_IDLE, TORSO_STAND, viewangles, moveangles, WP_MACHINEGUN, qfalse );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerModel_SaveChanges
|
||||
=================
|
||||
*/
|
||||
static void PlayerModel_SaveChanges( void )
|
||||
{
|
||||
trap_Cvar_Set( "model", s_playermodel.modelskin );
|
||||
trap_Cvar_Set( "headmodel", s_playermodel.modelskin );
|
||||
trap_Cvar_Set( "team_model", s_playermodel.modelskin );
|
||||
trap_Cvar_Set( "team_headmodel", s_playermodel.modelskin );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerModel_MenuEvent
|
||||
=================
|
||||
*/
|
||||
static void PlayerModel_MenuEvent( void* ptr, int event )
|
||||
{
|
||||
if (event != QM_ACTIVATED)
|
||||
return;
|
||||
|
||||
switch (((menucommon_s*)ptr)->id)
|
||||
{
|
||||
case ID_PREVPAGE:
|
||||
if (s_playermodel.modelpage > 0)
|
||||
{
|
||||
s_playermodel.modelpage--;
|
||||
PlayerModel_UpdateGrid();
|
||||
}
|
||||
break;
|
||||
|
||||
case ID_NEXTPAGE:
|
||||
if (s_playermodel.modelpage < s_playermodel.numpages-1)
|
||||
{
|
||||
s_playermodel.modelpage++;
|
||||
PlayerModel_UpdateGrid();
|
||||
}
|
||||
break;
|
||||
|
||||
case ID_BACK:
|
||||
PlayerModel_SaveChanges();
|
||||
UI_PopMenu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerModel_MenuKey
|
||||
=================
|
||||
*/
|
||||
static sfxHandle_t PlayerModel_MenuKey( int key )
|
||||
{
|
||||
menucommon_s* m;
|
||||
int picnum;
|
||||
|
||||
switch (key)
|
||||
{
|
||||
case K_KP_LEFTARROW:
|
||||
case K_LEFTARROW:
|
||||
m = Menu_ItemAtCursor(&s_playermodel.menu);
|
||||
picnum = m->id - ID_PLAYERPIC0;
|
||||
if (picnum >= 0 && picnum <= 15)
|
||||
{
|
||||
if (picnum > 0)
|
||||
{
|
||||
Menu_SetCursor(&s_playermodel.menu,s_playermodel.menu.cursor-1);
|
||||
return (menu_move_sound);
|
||||
|
||||
}
|
||||
else if (s_playermodel.modelpage > 0)
|
||||
{
|
||||
s_playermodel.modelpage--;
|
||||
Menu_SetCursor(&s_playermodel.menu,s_playermodel.menu.cursor+15);
|
||||
PlayerModel_UpdateGrid();
|
||||
return (menu_move_sound);
|
||||
}
|
||||
else
|
||||
return (menu_buzz_sound);
|
||||
}
|
||||
break;
|
||||
|
||||
case K_KP_RIGHTARROW:
|
||||
case K_RIGHTARROW:
|
||||
m = Menu_ItemAtCursor(&s_playermodel.menu);
|
||||
picnum = m->id - ID_PLAYERPIC0;
|
||||
if (picnum >= 0 && picnum <= 15)
|
||||
{
|
||||
if ((picnum < 15) && (s_playermodel.modelpage*MAX_MODELSPERPAGE + picnum+1 < s_playermodel.nummodels))
|
||||
{
|
||||
Menu_SetCursor(&s_playermodel.menu,s_playermodel.menu.cursor+1);
|
||||
return (menu_move_sound);
|
||||
}
|
||||
else if ((picnum == 15) && (s_playermodel.modelpage < s_playermodel.numpages-1))
|
||||
{
|
||||
s_playermodel.modelpage++;
|
||||
Menu_SetCursor(&s_playermodel.menu,s_playermodel.menu.cursor-15);
|
||||
PlayerModel_UpdateGrid();
|
||||
return (menu_move_sound);
|
||||
}
|
||||
else
|
||||
return (menu_buzz_sound);
|
||||
}
|
||||
break;
|
||||
|
||||
case K_MOUSE2:
|
||||
case K_ESCAPE:
|
||||
PlayerModel_SaveChanges();
|
||||
break;
|
||||
}
|
||||
|
||||
return ( Menu_DefaultKey( &s_playermodel.menu, key ) );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerModel_PicEvent
|
||||
=================
|
||||
*/
|
||||
static void PlayerModel_PicEvent( void* ptr, int event )
|
||||
{
|
||||
int modelnum;
|
||||
int maxlen;
|
||||
char* buffptr;
|
||||
char* pdest;
|
||||
int i;
|
||||
|
||||
if (event != QM_ACTIVATED)
|
||||
return;
|
||||
|
||||
for (i=0; i<PLAYERGRID_ROWS*PLAYERGRID_COLS; i++)
|
||||
{
|
||||
// reset
|
||||
s_playermodel.pics[i].generic.flags &= ~QMF_HIGHLIGHT;
|
||||
s_playermodel.picbuttons[i].generic.flags |= QMF_PULSEIFFOCUS;
|
||||
}
|
||||
|
||||
// set selected
|
||||
i = ((menucommon_s*)ptr)->id - ID_PLAYERPIC0;
|
||||
s_playermodel.pics[i].generic.flags |= QMF_HIGHLIGHT;
|
||||
s_playermodel.picbuttons[i].generic.flags &= ~QMF_PULSEIFFOCUS;
|
||||
|
||||
// get model and strip icon_
|
||||
modelnum = s_playermodel.modelpage*MAX_MODELSPERPAGE + i;
|
||||
buffptr = s_playermodel.modelnames[modelnum] + strlen("models/players/");
|
||||
pdest = strstr(buffptr,"icon_");
|
||||
if (pdest)
|
||||
{
|
||||
// track the whole model/skin name
|
||||
Q_strncpyz(s_playermodel.modelskin,buffptr,pdest-buffptr+1);
|
||||
strcat(s_playermodel.modelskin,pdest + 5);
|
||||
|
||||
// seperate the model name
|
||||
maxlen = pdest-buffptr;
|
||||
if (maxlen > 16)
|
||||
maxlen = 16;
|
||||
Q_strncpyz( s_playermodel.modelname.string, buffptr, maxlen );
|
||||
Q_strupr( s_playermodel.modelname.string );
|
||||
|
||||
// seperate the skin name
|
||||
maxlen = strlen(pdest+5)+1;
|
||||
if (maxlen > 16)
|
||||
maxlen = 16;
|
||||
Q_strncpyz( s_playermodel.skinname.string, pdest+5, maxlen );
|
||||
Q_strupr( s_playermodel.skinname.string );
|
||||
|
||||
s_playermodel.selectedmodel = modelnum;
|
||||
|
||||
if( trap_MemoryRemaining() > LOW_MEMORY ) {
|
||||
PlayerModel_UpdateModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerModel_DrawPlayer
|
||||
=================
|
||||
*/
|
||||
static void PlayerModel_DrawPlayer( void *self )
|
||||
{
|
||||
menubitmap_s* b;
|
||||
|
||||
b = (menubitmap_s*) self;
|
||||
|
||||
if( trap_MemoryRemaining() <= LOW_MEMORY ) {
|
||||
UI_DrawProportionalString( b->generic.x, b->generic.y + b->height / 2, "LOW MEMORY", UI_LEFT, color_red );
|
||||
return;
|
||||
}
|
||||
|
||||
UI_DrawPlayer( b->generic.x, b->generic.y, b->width, b->height, &s_playermodel.playerinfo, uis.realtime/2 );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerModel_BuildList
|
||||
=================
|
||||
*/
|
||||
static void PlayerModel_BuildList( void )
|
||||
{
|
||||
int numdirs;
|
||||
int numfiles;
|
||||
char dirlist[2048];
|
||||
char filelist[2048];
|
||||
char skinname[64];
|
||||
char* dirptr;
|
||||
char* fileptr;
|
||||
int i;
|
||||
int j;
|
||||
int dirlen;
|
||||
int filelen;
|
||||
qboolean precache;
|
||||
|
||||
precache = trap_Cvar_VariableValue("com_buildscript");
|
||||
|
||||
s_playermodel.modelpage = 0;
|
||||
s_playermodel.nummodels = 0;
|
||||
|
||||
// iterate directory of all player models
|
||||
numdirs = trap_FS_GetFileList("models/players", "/", dirlist, 2048 );
|
||||
dirptr = dirlist;
|
||||
for (i=0; i<numdirs && s_playermodel.nummodels < MAX_PLAYERMODELS; i++,dirptr+=dirlen+1)
|
||||
{
|
||||
dirlen = strlen(dirptr);
|
||||
|
||||
if (dirlen && dirptr[dirlen-1]=='/') dirptr[dirlen-1]='\0';
|
||||
|
||||
if (!strcmp(dirptr,".") || !strcmp(dirptr,".."))
|
||||
continue;
|
||||
|
||||
// iterate all skin files in directory
|
||||
numfiles = trap_FS_GetFileList( va("models/players/%s",dirptr), "tga", filelist, 2048 );
|
||||
fileptr = filelist;
|
||||
for (j=0; j<numfiles && s_playermodel.nummodels < MAX_PLAYERMODELS;j++,fileptr+=filelen+1)
|
||||
{
|
||||
filelen = strlen(fileptr);
|
||||
|
||||
COM_StripExtension(fileptr,skinname);
|
||||
|
||||
// look for icon_????
|
||||
if (!Q_stricmpn(skinname,"icon_",5))
|
||||
{
|
||||
Com_sprintf( s_playermodel.modelnames[s_playermodel.nummodels++],
|
||||
sizeof( s_playermodel.modelnames[s_playermodel.nummodels] ),
|
||||
"models/players/%s/%s", dirptr, skinname );
|
||||
//if (s_playermodel.nummodels >= MAX_PLAYERMODELS)
|
||||
// return;
|
||||
}
|
||||
|
||||
if( precache ) {
|
||||
trap_S_RegisterSound( va( "sound/player/announce/%s_wins.wav", skinname), qfalse );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//APSFIXME - Degenerate no models case
|
||||
|
||||
s_playermodel.numpages = s_playermodel.nummodels/MAX_MODELSPERPAGE;
|
||||
if (s_playermodel.nummodels % MAX_MODELSPERPAGE)
|
||||
s_playermodel.numpages++;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerModel_SetMenuItems
|
||||
=================
|
||||
*/
|
||||
static void PlayerModel_SetMenuItems( void )
|
||||
{
|
||||
int i;
|
||||
int maxlen;
|
||||
char modelskin[64];
|
||||
char* buffptr;
|
||||
char* pdest;
|
||||
|
||||
// name
|
||||
trap_Cvar_VariableStringBuffer( "name", s_playermodel.playername.string, 16 );
|
||||
Q_CleanStr( s_playermodel.playername.string );
|
||||
|
||||
// model
|
||||
trap_Cvar_VariableStringBuffer( "model", s_playermodel.modelskin, 64 );
|
||||
|
||||
// find model in our list
|
||||
for (i=0; i<s_playermodel.nummodels; i++)
|
||||
{
|
||||
// strip icon_
|
||||
buffptr = s_playermodel.modelnames[i] + strlen("models/players/");
|
||||
pdest = strstr(buffptr,"icon_");
|
||||
if (pdest)
|
||||
{
|
||||
Q_strncpyz(modelskin,buffptr,pdest-buffptr+1);
|
||||
strcat(modelskin,pdest + 5);
|
||||
}
|
||||
else
|
||||
continue;
|
||||
|
||||
if (!Q_stricmp( s_playermodel.modelskin, modelskin ))
|
||||
{
|
||||
// found pic, set selection here
|
||||
s_playermodel.selectedmodel = i;
|
||||
s_playermodel.modelpage = i/MAX_MODELSPERPAGE;
|
||||
|
||||
// seperate the model name
|
||||
maxlen = pdest-buffptr;
|
||||
if (maxlen > 16)
|
||||
maxlen = 16;
|
||||
Q_strncpyz( s_playermodel.modelname.string, buffptr, maxlen );
|
||||
Q_strupr( s_playermodel.modelname.string );
|
||||
|
||||
// seperate the skin name
|
||||
maxlen = strlen(pdest+5)+1;
|
||||
if (maxlen > 16)
|
||||
maxlen = 16;
|
||||
Q_strncpyz( s_playermodel.skinname.string, pdest+5, maxlen );
|
||||
Q_strupr( s_playermodel.skinname.string );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerModel_MenuInit
|
||||
=================
|
||||
*/
|
||||
static void PlayerModel_MenuInit( void )
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
int k;
|
||||
int x;
|
||||
int y;
|
||||
static char playername[32];
|
||||
static char modelname[32];
|
||||
static char skinname[32];
|
||||
|
||||
// zero set all our globals
|
||||
memset( &s_playermodel, 0 ,sizeof(playermodel_t) );
|
||||
|
||||
PlayerModel_Cache();
|
||||
|
||||
s_playermodel.menu.key = PlayerModel_MenuKey;
|
||||
s_playermodel.menu.wrapAround = qtrue;
|
||||
s_playermodel.menu.fullscreen = qtrue;
|
||||
|
||||
s_playermodel.banner.generic.type = MTYPE_BTEXT;
|
||||
s_playermodel.banner.generic.x = 320;
|
||||
s_playermodel.banner.generic.y = 16;
|
||||
s_playermodel.banner.string = "PLAYER MODEL";
|
||||
s_playermodel.banner.color = color_white;
|
||||
s_playermodel.banner.style = UI_CENTER;
|
||||
|
||||
s_playermodel.framel.generic.type = MTYPE_BITMAP;
|
||||
s_playermodel.framel.generic.name = MODEL_FRAMEL;
|
||||
s_playermodel.framel.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
|
||||
s_playermodel.framel.generic.x = 0;
|
||||
s_playermodel.framel.generic.y = 78;
|
||||
s_playermodel.framel.width = 256;
|
||||
s_playermodel.framel.height = 329;
|
||||
|
||||
s_playermodel.framer.generic.type = MTYPE_BITMAP;
|
||||
s_playermodel.framer.generic.name = MODEL_FRAMER;
|
||||
s_playermodel.framer.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
|
||||
s_playermodel.framer.generic.x = 376;
|
||||
s_playermodel.framer.generic.y = 76;
|
||||
s_playermodel.framer.width = 256;
|
||||
s_playermodel.framer.height = 334;
|
||||
|
||||
s_playermodel.ports.generic.type = MTYPE_BITMAP;
|
||||
s_playermodel.ports.generic.name = MODEL_PORTS;
|
||||
s_playermodel.ports.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
|
||||
s_playermodel.ports.generic.x = 50;
|
||||
s_playermodel.ports.generic.y = 59;
|
||||
s_playermodel.ports.width = 274;
|
||||
s_playermodel.ports.height = 274;
|
||||
|
||||
y = 59;
|
||||
for (i=0,k=0; i<PLAYERGRID_ROWS; i++)
|
||||
{
|
||||
x = 50;
|
||||
for (j=0; j<PLAYERGRID_COLS; j++,k++)
|
||||
{
|
||||
s_playermodel.pics[k].generic.type = MTYPE_BITMAP;
|
||||
s_playermodel.pics[k].generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
|
||||
s_playermodel.pics[k].generic.x = x;
|
||||
s_playermodel.pics[k].generic.y = y;
|
||||
s_playermodel.pics[k].width = 64;
|
||||
s_playermodel.pics[k].height = 64;
|
||||
s_playermodel.pics[k].focuspic = MODEL_SELECTED;
|
||||
s_playermodel.pics[k].focuscolor = colorRed;
|
||||
|
||||
s_playermodel.picbuttons[k].generic.type = MTYPE_BITMAP;
|
||||
s_playermodel.picbuttons[k].generic.flags = QMF_LEFT_JUSTIFY|QMF_NODEFAULTINIT|QMF_PULSEIFFOCUS;
|
||||
s_playermodel.picbuttons[k].generic.id = ID_PLAYERPIC0+k;
|
||||
s_playermodel.picbuttons[k].generic.callback = PlayerModel_PicEvent;
|
||||
s_playermodel.picbuttons[k].generic.x = x - 16;
|
||||
s_playermodel.picbuttons[k].generic.y = y - 16;
|
||||
s_playermodel.picbuttons[k].generic.left = x;
|
||||
s_playermodel.picbuttons[k].generic.top = y;
|
||||
s_playermodel.picbuttons[k].generic.right = x + 64;
|
||||
s_playermodel.picbuttons[k].generic.bottom = y + 64;
|
||||
s_playermodel.picbuttons[k].width = 128;
|
||||
s_playermodel.picbuttons[k].height = 128;
|
||||
s_playermodel.picbuttons[k].focuspic = MODEL_SELECT;
|
||||
s_playermodel.picbuttons[k].focuscolor = colorRed;
|
||||
|
||||
x += 64+6;
|
||||
}
|
||||
y += 64+6;
|
||||
}
|
||||
|
||||
s_playermodel.playername.generic.type = MTYPE_PTEXT;
|
||||
s_playermodel.playername.generic.flags = QMF_CENTER_JUSTIFY|QMF_INACTIVE;
|
||||
s_playermodel.playername.generic.x = 320;
|
||||
s_playermodel.playername.generic.y = 440;
|
||||
s_playermodel.playername.string = playername;
|
||||
s_playermodel.playername.style = UI_CENTER;
|
||||
s_playermodel.playername.color = text_color_normal;
|
||||
|
||||
s_playermodel.modelname.generic.type = MTYPE_PTEXT;
|
||||
s_playermodel.modelname.generic.flags = QMF_CENTER_JUSTIFY|QMF_INACTIVE;
|
||||
s_playermodel.modelname.generic.x = 497;
|
||||
s_playermodel.modelname.generic.y = 54;
|
||||
s_playermodel.modelname.string = modelname;
|
||||
s_playermodel.modelname.style = UI_CENTER;
|
||||
s_playermodel.modelname.color = text_color_normal;
|
||||
|
||||
s_playermodel.skinname.generic.type = MTYPE_PTEXT;
|
||||
s_playermodel.skinname.generic.flags = QMF_CENTER_JUSTIFY|QMF_INACTIVE;
|
||||
s_playermodel.skinname.generic.x = 497;
|
||||
s_playermodel.skinname.generic.y = 394;
|
||||
s_playermodel.skinname.string = skinname;
|
||||
s_playermodel.skinname.style = UI_CENTER;
|
||||
s_playermodel.skinname.color = text_color_normal;
|
||||
|
||||
s_playermodel.player.generic.type = MTYPE_BITMAP;
|
||||
s_playermodel.player.generic.flags = QMF_INACTIVE;
|
||||
s_playermodel.player.generic.ownerdraw = PlayerModel_DrawPlayer;
|
||||
s_playermodel.player.generic.x = 400;
|
||||
s_playermodel.player.generic.y = -40;
|
||||
s_playermodel.player.width = 32*10;
|
||||
s_playermodel.player.height = 56*10;
|
||||
|
||||
s_playermodel.arrows.generic.type = MTYPE_BITMAP;
|
||||
s_playermodel.arrows.generic.name = MODEL_ARROWS;
|
||||
s_playermodel.arrows.generic.flags = QMF_INACTIVE;
|
||||
s_playermodel.arrows.generic.x = 125;
|
||||
s_playermodel.arrows.generic.y = 340;
|
||||
s_playermodel.arrows.width = 128;
|
||||
s_playermodel.arrows.height = 32;
|
||||
|
||||
s_playermodel.left.generic.type = MTYPE_BITMAP;
|
||||
s_playermodel.left.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_playermodel.left.generic.callback = PlayerModel_MenuEvent;
|
||||
s_playermodel.left.generic.id = ID_PREVPAGE;
|
||||
s_playermodel.left.generic.x = 125;
|
||||
s_playermodel.left.generic.y = 340;
|
||||
s_playermodel.left.width = 64;
|
||||
s_playermodel.left.height = 32;
|
||||
s_playermodel.left.focuspic = MODEL_ARROWSL;
|
||||
|
||||
s_playermodel.right.generic.type = MTYPE_BITMAP;
|
||||
s_playermodel.right.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_playermodel.right.generic.callback = PlayerModel_MenuEvent;
|
||||
s_playermodel.right.generic.id = ID_NEXTPAGE;
|
||||
s_playermodel.right.generic.x = 125+61;
|
||||
s_playermodel.right.generic.y = 340;
|
||||
s_playermodel.right.width = 64;
|
||||
s_playermodel.right.height = 32;
|
||||
s_playermodel.right.focuspic = MODEL_ARROWSR;
|
||||
|
||||
s_playermodel.back.generic.type = MTYPE_BITMAP;
|
||||
s_playermodel.back.generic.name = MODEL_BACK0;
|
||||
s_playermodel.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_playermodel.back.generic.callback = PlayerModel_MenuEvent;
|
||||
s_playermodel.back.generic.id = ID_BACK;
|
||||
s_playermodel.back.generic.x = 0;
|
||||
s_playermodel.back.generic.y = 480-64;
|
||||
s_playermodel.back.width = 128;
|
||||
s_playermodel.back.height = 64;
|
||||
s_playermodel.back.focuspic = MODEL_BACK1;
|
||||
|
||||
Menu_AddItem( &s_playermodel.menu, &s_playermodel.banner );
|
||||
Menu_AddItem( &s_playermodel.menu, &s_playermodel.framel );
|
||||
Menu_AddItem( &s_playermodel.menu, &s_playermodel.framer );
|
||||
Menu_AddItem( &s_playermodel.menu, &s_playermodel.ports );
|
||||
Menu_AddItem( &s_playermodel.menu, &s_playermodel.playername );
|
||||
Menu_AddItem( &s_playermodel.menu, &s_playermodel.modelname );
|
||||
Menu_AddItem( &s_playermodel.menu, &s_playermodel.skinname );
|
||||
|
||||
for (i=0; i<MAX_MODELSPERPAGE; i++)
|
||||
{
|
||||
Menu_AddItem( &s_playermodel.menu, &s_playermodel.pics[i] );
|
||||
Menu_AddItem( &s_playermodel.menu, &s_playermodel.picbuttons[i] );
|
||||
}
|
||||
|
||||
Menu_AddItem( &s_playermodel.menu, &s_playermodel.player );
|
||||
Menu_AddItem( &s_playermodel.menu, &s_playermodel.arrows );
|
||||
Menu_AddItem( &s_playermodel.menu, &s_playermodel.left );
|
||||
Menu_AddItem( &s_playermodel.menu, &s_playermodel.right );
|
||||
Menu_AddItem( &s_playermodel.menu, &s_playermodel.back );
|
||||
|
||||
// find all available models
|
||||
// PlayerModel_BuildList();
|
||||
|
||||
// set initial states
|
||||
PlayerModel_SetMenuItems();
|
||||
|
||||
// update user interface
|
||||
PlayerModel_UpdateGrid();
|
||||
PlayerModel_UpdateModel();
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerModel_Cache
|
||||
=================
|
||||
*/
|
||||
void PlayerModel_Cache( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
for( i = 0; playermodel_artlist[i]; i++ ) {
|
||||
trap_R_RegisterShaderNoMip( playermodel_artlist[i] );
|
||||
}
|
||||
|
||||
PlayerModel_BuildList();
|
||||
for( i = 0; i < s_playermodel.nummodels; i++ ) {
|
||||
trap_R_RegisterShaderNoMip( s_playermodel.modelnames[i] );
|
||||
}
|
||||
}
|
||||
|
||||
void UI_PlayerModelMenu(void)
|
||||
{
|
||||
PlayerModel_MenuInit();
|
||||
|
||||
UI_PushMenu( &s_playermodel.menu );
|
||||
|
||||
Menu_SetCursorToItem( &s_playermodel.menu, &s_playermodel.pics[s_playermodel.selectedmodel % MAX_MODELSPERPAGE] );
|
||||
}
|
||||
|
||||
|
||||
1228
code/q3_ui/.svn/text-base/ui_players.c.svn-base
Executable file
1228
code/q3_ui/.svn/text-base/ui_players.c.svn-base
Executable file
File diff suppressed because it is too large
Load Diff
493
code/q3_ui/.svn/text-base/ui_playersettings.c.svn-base
Executable file
493
code/q3_ui/.svn/text-base/ui_playersettings.c.svn-base
Executable file
@@ -0,0 +1,493 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
#include "ui_local.h"
|
||||
|
||||
#define ART_FRAMEL "menu/art/frame2_l"
|
||||
#define ART_FRAMER "menu/art/frame1_r"
|
||||
#define ART_MODEL0 "menu/art/model_0"
|
||||
#define ART_MODEL1 "menu/art/model_1"
|
||||
#define ART_BACK0 "menu/art/back_0"
|
||||
#define ART_BACK1 "menu/art/back_1"
|
||||
#define ART_FX_BASE "menu/art/fx_base"
|
||||
#define ART_FX_BLUE "menu/art/fx_blue"
|
||||
#define ART_FX_CYAN "menu/art/fx_cyan"
|
||||
#define ART_FX_GREEN "menu/art/fx_grn"
|
||||
#define ART_FX_RED "menu/art/fx_red"
|
||||
#define ART_FX_TEAL "menu/art/fx_teal"
|
||||
#define ART_FX_WHITE "menu/art/fx_white"
|
||||
#define ART_FX_YELLOW "menu/art/fx_yel"
|
||||
|
||||
#define ID_NAME 10
|
||||
#define ID_HANDICAP 11
|
||||
#define ID_EFFECTS 12
|
||||
#define ID_BACK 13
|
||||
#define ID_MODEL 14
|
||||
|
||||
#define MAX_NAMELENGTH 20
|
||||
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
|
||||
menutext_s banner;
|
||||
menubitmap_s framel;
|
||||
menubitmap_s framer;
|
||||
menubitmap_s player;
|
||||
|
||||
menufield_s name;
|
||||
menulist_s handicap;
|
||||
menulist_s effects;
|
||||
|
||||
menubitmap_s back;
|
||||
menubitmap_s model;
|
||||
menubitmap_s item_null;
|
||||
|
||||
qhandle_t fxBasePic;
|
||||
qhandle_t fxPic[7];
|
||||
playerInfo_t playerinfo;
|
||||
int current_fx;
|
||||
char playerModel[MAX_QPATH];
|
||||
} playersettings_t;
|
||||
|
||||
static playersettings_t s_playersettings;
|
||||
|
||||
static int gamecodetoui[] = {4,2,3,0,5,1,6};
|
||||
static int uitogamecode[] = {4,6,2,3,1,5,7};
|
||||
|
||||
static const char *handicap_items[] = {
|
||||
"None",
|
||||
"95",
|
||||
"90",
|
||||
"85",
|
||||
"80",
|
||||
"75",
|
||||
"70",
|
||||
"65",
|
||||
"60",
|
||||
"55",
|
||||
"50",
|
||||
"45",
|
||||
"40",
|
||||
"35",
|
||||
"30",
|
||||
"25",
|
||||
"20",
|
||||
"15",
|
||||
"10",
|
||||
"5",
|
||||
0
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerSettings_DrawName
|
||||
=================
|
||||
*/
|
||||
static void PlayerSettings_DrawName( void *self ) {
|
||||
menufield_s *f;
|
||||
qboolean focus;
|
||||
int style;
|
||||
char *txt;
|
||||
char c;
|
||||
float *color;
|
||||
int n;
|
||||
int basex, x, y;
|
||||
char name[32];
|
||||
|
||||
f = (menufield_s*)self;
|
||||
basex = f->generic.x;
|
||||
y = f->generic.y;
|
||||
focus = (f->generic.parent->cursor == f->generic.menuPosition);
|
||||
|
||||
style = UI_LEFT|UI_SMALLFONT;
|
||||
color = text_color_normal;
|
||||
if( focus ) {
|
||||
style |= UI_PULSE;
|
||||
color = text_color_highlight;
|
||||
}
|
||||
|
||||
UI_DrawProportionalString( basex, y, "Name", style, color );
|
||||
|
||||
// draw the actual name
|
||||
basex += 64;
|
||||
y += PROP_HEIGHT;
|
||||
txt = f->field.buffer;
|
||||
color = g_color_table[ColorIndex(COLOR_WHITE)];
|
||||
x = basex;
|
||||
while ( (c = *txt) != 0 ) {
|
||||
if ( !focus && Q_IsColorString( txt ) ) {
|
||||
n = ColorIndex( *(txt+1) );
|
||||
if( n == 0 ) {
|
||||
n = 7;
|
||||
}
|
||||
color = g_color_table[n];
|
||||
txt += 2;
|
||||
continue;
|
||||
}
|
||||
UI_DrawChar( x, y, c, style, color );
|
||||
txt++;
|
||||
x += SMALLCHAR_WIDTH;
|
||||
}
|
||||
|
||||
// draw cursor if we have focus
|
||||
if( focus ) {
|
||||
if ( trap_Key_GetOverstrikeMode() ) {
|
||||
c = 11;
|
||||
} else {
|
||||
c = 10;
|
||||
}
|
||||
|
||||
style &= ~UI_PULSE;
|
||||
style |= UI_BLINK;
|
||||
|
||||
UI_DrawChar( basex + f->field.cursor * SMALLCHAR_WIDTH, y, c, style, color_white );
|
||||
}
|
||||
|
||||
// draw at bottom also using proportional font
|
||||
Q_strncpyz( name, f->field.buffer, sizeof(name) );
|
||||
Q_CleanStr( name );
|
||||
UI_DrawProportionalString( 320, 440, name, UI_CENTER|UI_BIGFONT, text_color_normal );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerSettings_DrawHandicap
|
||||
=================
|
||||
*/
|
||||
static void PlayerSettings_DrawHandicap( void *self ) {
|
||||
menulist_s *item;
|
||||
qboolean focus;
|
||||
int style;
|
||||
float *color;
|
||||
|
||||
item = (menulist_s *)self;
|
||||
focus = (item->generic.parent->cursor == item->generic.menuPosition);
|
||||
|
||||
style = UI_LEFT|UI_SMALLFONT;
|
||||
color = text_color_normal;
|
||||
if( focus ) {
|
||||
style |= UI_PULSE;
|
||||
color = text_color_highlight;
|
||||
}
|
||||
|
||||
UI_DrawProportionalString( item->generic.x, item->generic.y, "Handicap", style, color );
|
||||
UI_DrawProportionalString( item->generic.x + 64, item->generic.y + PROP_HEIGHT, handicap_items[item->curvalue], style, color );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerSettings_DrawEffects
|
||||
=================
|
||||
*/
|
||||
static void PlayerSettings_DrawEffects( void *self ) {
|
||||
menulist_s *item;
|
||||
qboolean focus;
|
||||
int style;
|
||||
float *color;
|
||||
|
||||
item = (menulist_s *)self;
|
||||
focus = (item->generic.parent->cursor == item->generic.menuPosition);
|
||||
|
||||
style = UI_LEFT|UI_SMALLFONT;
|
||||
color = text_color_normal;
|
||||
if( focus ) {
|
||||
style |= UI_PULSE;
|
||||
color = text_color_highlight;
|
||||
}
|
||||
|
||||
UI_DrawProportionalString( item->generic.x, item->generic.y, "Effects", style, color );
|
||||
|
||||
UI_DrawHandlePic( item->generic.x + 64, item->generic.y + PROP_HEIGHT + 8, 128, 8, s_playersettings.fxBasePic );
|
||||
UI_DrawHandlePic( item->generic.x + 64 + item->curvalue * 16 + 8, item->generic.y + PROP_HEIGHT + 6, 16, 12, s_playersettings.fxPic[item->curvalue] );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerSettings_DrawPlayer
|
||||
=================
|
||||
*/
|
||||
static void PlayerSettings_DrawPlayer( void *self ) {
|
||||
menubitmap_s *b;
|
||||
vec3_t viewangles;
|
||||
char buf[MAX_QPATH];
|
||||
|
||||
trap_Cvar_VariableStringBuffer( "model", buf, sizeof( buf ) );
|
||||
if ( strcmp( buf, s_playersettings.playerModel ) != 0 ) {
|
||||
UI_PlayerInfo_SetModel( &s_playersettings.playerinfo, buf );
|
||||
strcpy( s_playersettings.playerModel, buf );
|
||||
|
||||
viewangles[YAW] = 180 - 30;
|
||||
viewangles[PITCH] = 0;
|
||||
viewangles[ROLL] = 0;
|
||||
UI_PlayerInfo_SetInfo( &s_playersettings.playerinfo, LEGS_IDLE, TORSO_STAND, viewangles, vec3_origin, WP_MACHINEGUN, qfalse );
|
||||
}
|
||||
|
||||
b = (menubitmap_s*) self;
|
||||
UI_DrawPlayer( b->generic.x, b->generic.y, b->width, b->height, &s_playersettings.playerinfo, uis.realtime/2 );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerSettings_SaveChanges
|
||||
=================
|
||||
*/
|
||||
static void PlayerSettings_SaveChanges( void ) {
|
||||
// name
|
||||
trap_Cvar_Set( "name", s_playersettings.name.field.buffer );
|
||||
|
||||
// handicap
|
||||
trap_Cvar_SetValue( "handicap", 100 - s_playersettings.handicap.curvalue * 5 );
|
||||
|
||||
// effects color
|
||||
trap_Cvar_SetValue( "color1", uitogamecode[s_playersettings.effects.curvalue] );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerSettings_MenuKey
|
||||
=================
|
||||
*/
|
||||
static sfxHandle_t PlayerSettings_MenuKey( int key ) {
|
||||
if( key == K_MOUSE2 || key == K_ESCAPE ) {
|
||||
PlayerSettings_SaveChanges();
|
||||
}
|
||||
return Menu_DefaultKey( &s_playersettings.menu, key );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerSettings_SetMenuItems
|
||||
=================
|
||||
*/
|
||||
static void PlayerSettings_SetMenuItems( void ) {
|
||||
vec3_t viewangles;
|
||||
int c;
|
||||
int h;
|
||||
|
||||
// name
|
||||
Q_strncpyz( s_playersettings.name.field.buffer, UI_Cvar_VariableString("name"), sizeof(s_playersettings.name.field.buffer) );
|
||||
|
||||
// effects color
|
||||
c = trap_Cvar_VariableValue( "color1" ) - 1;
|
||||
if( c < 0 || c > 6 ) {
|
||||
c = 6;
|
||||
}
|
||||
s_playersettings.effects.curvalue = gamecodetoui[c];
|
||||
|
||||
// model/skin
|
||||
memset( &s_playersettings.playerinfo, 0, sizeof(playerInfo_t) );
|
||||
|
||||
viewangles[YAW] = 180 - 30;
|
||||
viewangles[PITCH] = 0;
|
||||
viewangles[ROLL] = 0;
|
||||
|
||||
UI_PlayerInfo_SetModel( &s_playersettings.playerinfo, UI_Cvar_VariableString( "model" ) );
|
||||
UI_PlayerInfo_SetInfo( &s_playersettings.playerinfo, LEGS_IDLE, TORSO_STAND, viewangles, vec3_origin, WP_MACHINEGUN, qfalse );
|
||||
|
||||
// handicap
|
||||
h = Com_Clamp( 5, 100, trap_Cvar_VariableValue("handicap") );
|
||||
s_playersettings.handicap.curvalue = 20 - h / 5;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerSettings_MenuEvent
|
||||
=================
|
||||
*/
|
||||
static void PlayerSettings_MenuEvent( void* ptr, int event ) {
|
||||
if( event != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch( ((menucommon_s*)ptr)->id ) {
|
||||
case ID_HANDICAP:
|
||||
trap_Cvar_Set( "handicap", va( "%i", 100 - 25 * s_playersettings.handicap.curvalue ) );
|
||||
break;
|
||||
|
||||
case ID_MODEL:
|
||||
PlayerSettings_SaveChanges();
|
||||
UI_PlayerModelMenu();
|
||||
break;
|
||||
|
||||
case ID_BACK:
|
||||
PlayerSettings_SaveChanges();
|
||||
UI_PopMenu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerSettings_MenuInit
|
||||
=================
|
||||
*/
|
||||
static void PlayerSettings_MenuInit( void ) {
|
||||
int y;
|
||||
|
||||
memset(&s_playersettings,0,sizeof(playersettings_t));
|
||||
|
||||
PlayerSettings_Cache();
|
||||
|
||||
s_playersettings.menu.key = PlayerSettings_MenuKey;
|
||||
s_playersettings.menu.wrapAround = qtrue;
|
||||
s_playersettings.menu.fullscreen = qtrue;
|
||||
|
||||
s_playersettings.banner.generic.type = MTYPE_BTEXT;
|
||||
s_playersettings.banner.generic.x = 320;
|
||||
s_playersettings.banner.generic.y = 16;
|
||||
s_playersettings.banner.string = "PLAYER SETTINGS";
|
||||
s_playersettings.banner.color = color_white;
|
||||
s_playersettings.banner.style = UI_CENTER;
|
||||
|
||||
s_playersettings.framel.generic.type = MTYPE_BITMAP;
|
||||
s_playersettings.framel.generic.name = ART_FRAMEL;
|
||||
s_playersettings.framel.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
|
||||
s_playersettings.framel.generic.x = 0;
|
||||
s_playersettings.framel.generic.y = 78;
|
||||
s_playersettings.framel.width = 256;
|
||||
s_playersettings.framel.height = 329;
|
||||
|
||||
s_playersettings.framer.generic.type = MTYPE_BITMAP;
|
||||
s_playersettings.framer.generic.name = ART_FRAMER;
|
||||
s_playersettings.framer.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
|
||||
s_playersettings.framer.generic.x = 376;
|
||||
s_playersettings.framer.generic.y = 76;
|
||||
s_playersettings.framer.width = 256;
|
||||
s_playersettings.framer.height = 334;
|
||||
|
||||
y = 144;
|
||||
s_playersettings.name.generic.type = MTYPE_FIELD;
|
||||
s_playersettings.name.generic.flags = QMF_NODEFAULTINIT;
|
||||
s_playersettings.name.generic.ownerdraw = PlayerSettings_DrawName;
|
||||
s_playersettings.name.field.widthInChars = MAX_NAMELENGTH;
|
||||
s_playersettings.name.field.maxchars = MAX_NAMELENGTH;
|
||||
s_playersettings.name.generic.x = 192;
|
||||
s_playersettings.name.generic.y = y;
|
||||
s_playersettings.name.generic.left = 192 - 8;
|
||||
s_playersettings.name.generic.top = y - 8;
|
||||
s_playersettings.name.generic.right = 192 + 200;
|
||||
s_playersettings.name.generic.bottom = y + 2 * PROP_HEIGHT;
|
||||
|
||||
y += 3 * PROP_HEIGHT;
|
||||
s_playersettings.handicap.generic.type = MTYPE_SPINCONTROL;
|
||||
s_playersettings.handicap.generic.flags = QMF_NODEFAULTINIT;
|
||||
s_playersettings.handicap.generic.id = ID_HANDICAP;
|
||||
s_playersettings.handicap.generic.ownerdraw = PlayerSettings_DrawHandicap;
|
||||
s_playersettings.handicap.generic.x = 192;
|
||||
s_playersettings.handicap.generic.y = y;
|
||||
s_playersettings.handicap.generic.left = 192 - 8;
|
||||
s_playersettings.handicap.generic.top = y - 8;
|
||||
s_playersettings.handicap.generic.right = 192 + 200;
|
||||
s_playersettings.handicap.generic.bottom = y + 2 * PROP_HEIGHT;
|
||||
s_playersettings.handicap.numitems = 20;
|
||||
|
||||
y += 3 * PROP_HEIGHT;
|
||||
s_playersettings.effects.generic.type = MTYPE_SPINCONTROL;
|
||||
s_playersettings.effects.generic.flags = QMF_NODEFAULTINIT;
|
||||
s_playersettings.effects.generic.id = ID_EFFECTS;
|
||||
s_playersettings.effects.generic.ownerdraw = PlayerSettings_DrawEffects;
|
||||
s_playersettings.effects.generic.x = 192;
|
||||
s_playersettings.effects.generic.y = y;
|
||||
s_playersettings.effects.generic.left = 192 - 8;
|
||||
s_playersettings.effects.generic.top = y - 8;
|
||||
s_playersettings.effects.generic.right = 192 + 200;
|
||||
s_playersettings.effects.generic.bottom = y + 2* PROP_HEIGHT;
|
||||
s_playersettings.effects.numitems = 7;
|
||||
|
||||
s_playersettings.model.generic.type = MTYPE_BITMAP;
|
||||
s_playersettings.model.generic.name = ART_MODEL0;
|
||||
s_playersettings.model.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_playersettings.model.generic.id = ID_MODEL;
|
||||
s_playersettings.model.generic.callback = PlayerSettings_MenuEvent;
|
||||
s_playersettings.model.generic.x = 640;
|
||||
s_playersettings.model.generic.y = 480-64;
|
||||
s_playersettings.model.width = 128;
|
||||
s_playersettings.model.height = 64;
|
||||
s_playersettings.model.focuspic = ART_MODEL1;
|
||||
|
||||
s_playersettings.player.generic.type = MTYPE_BITMAP;
|
||||
s_playersettings.player.generic.flags = QMF_INACTIVE;
|
||||
s_playersettings.player.generic.ownerdraw = PlayerSettings_DrawPlayer;
|
||||
s_playersettings.player.generic.x = 400;
|
||||
s_playersettings.player.generic.y = -40;
|
||||
s_playersettings.player.width = 32*10;
|
||||
s_playersettings.player.height = 56*10;
|
||||
|
||||
s_playersettings.back.generic.type = MTYPE_BITMAP;
|
||||
s_playersettings.back.generic.name = ART_BACK0;
|
||||
s_playersettings.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_playersettings.back.generic.id = ID_BACK;
|
||||
s_playersettings.back.generic.callback = PlayerSettings_MenuEvent;
|
||||
s_playersettings.back.generic.x = 0;
|
||||
s_playersettings.back.generic.y = 480-64;
|
||||
s_playersettings.back.width = 128;
|
||||
s_playersettings.back.height = 64;
|
||||
s_playersettings.back.focuspic = ART_BACK1;
|
||||
|
||||
s_playersettings.item_null.generic.type = MTYPE_BITMAP;
|
||||
s_playersettings.item_null.generic.flags = QMF_LEFT_JUSTIFY|QMF_MOUSEONLY|QMF_SILENT;
|
||||
s_playersettings.item_null.generic.x = 0;
|
||||
s_playersettings.item_null.generic.y = 0;
|
||||
s_playersettings.item_null.width = 640;
|
||||
s_playersettings.item_null.height = 480;
|
||||
|
||||
Menu_AddItem( &s_playersettings.menu, &s_playersettings.banner );
|
||||
Menu_AddItem( &s_playersettings.menu, &s_playersettings.framel );
|
||||
Menu_AddItem( &s_playersettings.menu, &s_playersettings.framer );
|
||||
|
||||
Menu_AddItem( &s_playersettings.menu, &s_playersettings.name );
|
||||
Menu_AddItem( &s_playersettings.menu, &s_playersettings.handicap );
|
||||
Menu_AddItem( &s_playersettings.menu, &s_playersettings.effects );
|
||||
Menu_AddItem( &s_playersettings.menu, &s_playersettings.model );
|
||||
Menu_AddItem( &s_playersettings.menu, &s_playersettings.back );
|
||||
|
||||
Menu_AddItem( &s_playersettings.menu, &s_playersettings.player );
|
||||
|
||||
Menu_AddItem( &s_playersettings.menu, &s_playersettings.item_null );
|
||||
|
||||
PlayerSettings_SetMenuItems();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
PlayerSettings_Cache
|
||||
=================
|
||||
*/
|
||||
void PlayerSettings_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMEL );
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMER );
|
||||
trap_R_RegisterShaderNoMip( ART_MODEL0 );
|
||||
trap_R_RegisterShaderNoMip( ART_MODEL1 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK0 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK1 );
|
||||
|
||||
s_playersettings.fxBasePic = trap_R_RegisterShaderNoMip( ART_FX_BASE );
|
||||
s_playersettings.fxPic[0] = trap_R_RegisterShaderNoMip( ART_FX_RED );
|
||||
s_playersettings.fxPic[1] = trap_R_RegisterShaderNoMip( ART_FX_YELLOW );
|
||||
s_playersettings.fxPic[2] = trap_R_RegisterShaderNoMip( ART_FX_GREEN );
|
||||
s_playersettings.fxPic[3] = trap_R_RegisterShaderNoMip( ART_FX_TEAL );
|
||||
s_playersettings.fxPic[4] = trap_R_RegisterShaderNoMip( ART_FX_BLUE );
|
||||
s_playersettings.fxPic[5] = trap_R_RegisterShaderNoMip( ART_FX_CYAN );
|
||||
s_playersettings.fxPic[6] = trap_R_RegisterShaderNoMip( ART_FX_WHITE );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_PlayerSettingsMenu
|
||||
=================
|
||||
*/
|
||||
void UI_PlayerSettingsMenu( void ) {
|
||||
PlayerSettings_MenuInit();
|
||||
UI_PushMenu( &s_playersettings.menu );
|
||||
}
|
||||
399
code/q3_ui/.svn/text-base/ui_preferences.c.svn-base
Executable file
399
code/q3_ui/.svn/text-base/ui_preferences.c.svn-base
Executable file
@@ -0,0 +1,399 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
/*
|
||||
=======================================================================
|
||||
|
||||
GAME OPTIONS MENU
|
||||
|
||||
=======================================================================
|
||||
*/
|
||||
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define ART_FRAMEL "menu/art/frame2_l"
|
||||
#define ART_FRAMER "menu/art/frame1_r"
|
||||
#define ART_BACK0 "menu/art/back_0"
|
||||
#define ART_BACK1 "menu/art/back_1"
|
||||
|
||||
#define PREFERENCES_X_POS 360
|
||||
|
||||
#define ID_CROSSHAIR 127
|
||||
#define ID_SIMPLEITEMS 128
|
||||
#define ID_HIGHQUALITYSKY 129
|
||||
#define ID_EJECTINGBRASS 130
|
||||
#define ID_WALLMARKS 131
|
||||
#define ID_DYNAMICLIGHTS 132
|
||||
#define ID_IDENTIFYTARGET 133
|
||||
#define ID_SYNCEVERYFRAME 134
|
||||
#define ID_FORCEMODEL 135
|
||||
#define ID_DRAWTEAMOVERLAY 136
|
||||
#define ID_ALLOWDOWNLOAD 137
|
||||
#define ID_BACK 138
|
||||
|
||||
#define NUM_CROSSHAIRS 10
|
||||
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
|
||||
menutext_s banner;
|
||||
menubitmap_s framel;
|
||||
menubitmap_s framer;
|
||||
|
||||
menulist_s crosshair;
|
||||
menuradiobutton_s simpleitems;
|
||||
menuradiobutton_s brass;
|
||||
menuradiobutton_s wallmarks;
|
||||
menuradiobutton_s dynamiclights;
|
||||
menuradiobutton_s identifytarget;
|
||||
menuradiobutton_s highqualitysky;
|
||||
menuradiobutton_s synceveryframe;
|
||||
menuradiobutton_s forcemodel;
|
||||
menulist_s drawteamoverlay;
|
||||
menuradiobutton_s allowdownload;
|
||||
menubitmap_s back;
|
||||
|
||||
qhandle_t crosshairShader[NUM_CROSSHAIRS];
|
||||
} preferences_t;
|
||||
|
||||
static preferences_t s_preferences;
|
||||
|
||||
static const char *teamoverlay_names[] =
|
||||
{
|
||||
"off",
|
||||
"upper right",
|
||||
"lower right",
|
||||
"lower left",
|
||||
0
|
||||
};
|
||||
|
||||
static void Preferences_SetMenuItems( void ) {
|
||||
s_preferences.crosshair.curvalue = (int)trap_Cvar_VariableValue( "cg_drawCrosshair" ) % NUM_CROSSHAIRS;
|
||||
s_preferences.simpleitems.curvalue = trap_Cvar_VariableValue( "cg_simpleItems" ) != 0;
|
||||
s_preferences.brass.curvalue = trap_Cvar_VariableValue( "cg_brassTime" ) != 0;
|
||||
s_preferences.wallmarks.curvalue = trap_Cvar_VariableValue( "cg_marks" ) != 0;
|
||||
s_preferences.identifytarget.curvalue = trap_Cvar_VariableValue( "cg_drawCrosshairNames" ) != 0;
|
||||
s_preferences.dynamiclights.curvalue = trap_Cvar_VariableValue( "r_dynamiclight" ) != 0;
|
||||
s_preferences.highqualitysky.curvalue = trap_Cvar_VariableValue ( "r_fastsky" ) == 0;
|
||||
s_preferences.synceveryframe.curvalue = trap_Cvar_VariableValue( "r_finish" ) != 0;
|
||||
s_preferences.forcemodel.curvalue = trap_Cvar_VariableValue( "cg_forcemodel" ) != 0;
|
||||
s_preferences.drawteamoverlay.curvalue = Com_Clamp( 0, 3, trap_Cvar_VariableValue( "cg_drawTeamOverlay" ) );
|
||||
s_preferences.allowdownload.curvalue = trap_Cvar_VariableValue( "cl_allowDownload" ) != 0;
|
||||
}
|
||||
|
||||
|
||||
static void Preferences_Event( void* ptr, int notification ) {
|
||||
if( notification != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch( ((menucommon_s*)ptr)->id ) {
|
||||
case ID_CROSSHAIR:
|
||||
s_preferences.crosshair.curvalue++;
|
||||
if( s_preferences.crosshair.curvalue == NUM_CROSSHAIRS ) {
|
||||
s_preferences.crosshair.curvalue = 0;
|
||||
}
|
||||
trap_Cvar_SetValue( "cg_drawCrosshair", s_preferences.crosshair.curvalue );
|
||||
break;
|
||||
|
||||
case ID_SIMPLEITEMS:
|
||||
trap_Cvar_SetValue( "cg_simpleItems", s_preferences.simpleitems.curvalue );
|
||||
break;
|
||||
|
||||
case ID_HIGHQUALITYSKY:
|
||||
trap_Cvar_SetValue( "r_fastsky", !s_preferences.highqualitysky.curvalue );
|
||||
break;
|
||||
|
||||
case ID_EJECTINGBRASS:
|
||||
if ( s_preferences.brass.curvalue )
|
||||
trap_Cvar_Reset( "cg_brassTime" );
|
||||
else
|
||||
trap_Cvar_SetValue( "cg_brassTime", 0 );
|
||||
break;
|
||||
|
||||
case ID_WALLMARKS:
|
||||
trap_Cvar_SetValue( "cg_marks", s_preferences.wallmarks.curvalue );
|
||||
break;
|
||||
|
||||
case ID_DYNAMICLIGHTS:
|
||||
trap_Cvar_SetValue( "r_dynamiclight", s_preferences.dynamiclights.curvalue );
|
||||
break;
|
||||
|
||||
case ID_IDENTIFYTARGET:
|
||||
trap_Cvar_SetValue( "cg_drawCrosshairNames", s_preferences.identifytarget.curvalue );
|
||||
break;
|
||||
|
||||
case ID_SYNCEVERYFRAME:
|
||||
trap_Cvar_SetValue( "r_finish", s_preferences.synceveryframe.curvalue );
|
||||
break;
|
||||
|
||||
case ID_FORCEMODEL:
|
||||
trap_Cvar_SetValue( "cg_forcemodel", s_preferences.forcemodel.curvalue );
|
||||
break;
|
||||
|
||||
case ID_DRAWTEAMOVERLAY:
|
||||
trap_Cvar_SetValue( "cg_drawTeamOverlay", s_preferences.drawteamoverlay.curvalue );
|
||||
break;
|
||||
|
||||
case ID_ALLOWDOWNLOAD:
|
||||
trap_Cvar_SetValue( "cl_allowDownload", s_preferences.allowdownload.curvalue );
|
||||
trap_Cvar_SetValue( "sv_allowDownload", s_preferences.allowdownload.curvalue );
|
||||
break;
|
||||
|
||||
case ID_BACK:
|
||||
UI_PopMenu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
Crosshair_Draw
|
||||
=================
|
||||
*/
|
||||
static void Crosshair_Draw( void *self ) {
|
||||
menulist_s *s;
|
||||
float *color;
|
||||
int x, y;
|
||||
int style;
|
||||
qboolean focus;
|
||||
|
||||
s = (menulist_s *)self;
|
||||
x = s->generic.x;
|
||||
y = s->generic.y;
|
||||
|
||||
style = UI_SMALLFONT;
|
||||
focus = (s->generic.parent->cursor == s->generic.menuPosition);
|
||||
|
||||
if ( s->generic.flags & QMF_GRAYED )
|
||||
color = text_color_disabled;
|
||||
else if ( focus )
|
||||
{
|
||||
color = text_color_highlight;
|
||||
style |= UI_PULSE;
|
||||
}
|
||||
else if ( s->generic.flags & QMF_BLINK )
|
||||
{
|
||||
color = text_color_highlight;
|
||||
style |= UI_BLINK;
|
||||
}
|
||||
else
|
||||
color = text_color_normal;
|
||||
|
||||
if ( focus )
|
||||
{
|
||||
// draw cursor
|
||||
UI_FillRect( s->generic.left, s->generic.top, s->generic.right-s->generic.left+1, s->generic.bottom-s->generic.top+1, listbar_color );
|
||||
UI_DrawChar( x, y, 13, UI_CENTER|UI_BLINK|UI_SMALLFONT, color);
|
||||
}
|
||||
|
||||
UI_DrawString( x - SMALLCHAR_WIDTH, y, s->generic.name, style|UI_RIGHT, color );
|
||||
if( !s->curvalue ) {
|
||||
return;
|
||||
}
|
||||
UI_DrawHandlePic( x + SMALLCHAR_WIDTH, y - 4, 24, 24, s_preferences.crosshairShader[s->curvalue] );
|
||||
}
|
||||
|
||||
|
||||
static void Preferences_MenuInit( void ) {
|
||||
int y;
|
||||
|
||||
memset( &s_preferences, 0 ,sizeof(preferences_t) );
|
||||
|
||||
Preferences_Cache();
|
||||
|
||||
s_preferences.menu.wrapAround = qtrue;
|
||||
s_preferences.menu.fullscreen = qtrue;
|
||||
|
||||
s_preferences.banner.generic.type = MTYPE_BTEXT;
|
||||
s_preferences.banner.generic.x = 320;
|
||||
s_preferences.banner.generic.y = 16;
|
||||
s_preferences.banner.string = "GAME OPTIONS";
|
||||
s_preferences.banner.color = color_white;
|
||||
s_preferences.banner.style = UI_CENTER;
|
||||
|
||||
s_preferences.framel.generic.type = MTYPE_BITMAP;
|
||||
s_preferences.framel.generic.name = ART_FRAMEL;
|
||||
s_preferences.framel.generic.flags = QMF_INACTIVE;
|
||||
s_preferences.framel.generic.x = 0;
|
||||
s_preferences.framel.generic.y = 78;
|
||||
s_preferences.framel.width = 256;
|
||||
s_preferences.framel.height = 329;
|
||||
|
||||
s_preferences.framer.generic.type = MTYPE_BITMAP;
|
||||
s_preferences.framer.generic.name = ART_FRAMER;
|
||||
s_preferences.framer.generic.flags = QMF_INACTIVE;
|
||||
s_preferences.framer.generic.x = 376;
|
||||
s_preferences.framer.generic.y = 76;
|
||||
s_preferences.framer.width = 256;
|
||||
s_preferences.framer.height = 334;
|
||||
|
||||
y = 144;
|
||||
s_preferences.crosshair.generic.type = MTYPE_TEXT;
|
||||
s_preferences.crosshair.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT|QMF_NODEFAULTINIT|QMF_OWNERDRAW;
|
||||
s_preferences.crosshair.generic.x = PREFERENCES_X_POS;
|
||||
s_preferences.crosshair.generic.y = y;
|
||||
s_preferences.crosshair.generic.name = "Crosshair:";
|
||||
s_preferences.crosshair.generic.callback = Preferences_Event;
|
||||
s_preferences.crosshair.generic.ownerdraw = Crosshair_Draw;
|
||||
s_preferences.crosshair.generic.id = ID_CROSSHAIR;
|
||||
s_preferences.crosshair.generic.top = y - 4;
|
||||
s_preferences.crosshair.generic.bottom = y + 20;
|
||||
s_preferences.crosshair.generic.left = PREFERENCES_X_POS - ( ( strlen(s_preferences.crosshair.generic.name) + 1 ) * SMALLCHAR_WIDTH );
|
||||
s_preferences.crosshair.generic.right = PREFERENCES_X_POS + 48;
|
||||
|
||||
y += BIGCHAR_HEIGHT+2+4;
|
||||
s_preferences.simpleitems.generic.type = MTYPE_RADIOBUTTON;
|
||||
s_preferences.simpleitems.generic.name = "Simple Items:";
|
||||
s_preferences.simpleitems.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_preferences.simpleitems.generic.callback = Preferences_Event;
|
||||
s_preferences.simpleitems.generic.id = ID_SIMPLEITEMS;
|
||||
s_preferences.simpleitems.generic.x = PREFERENCES_X_POS;
|
||||
s_preferences.simpleitems.generic.y = y;
|
||||
|
||||
y += BIGCHAR_HEIGHT;
|
||||
s_preferences.wallmarks.generic.type = MTYPE_RADIOBUTTON;
|
||||
s_preferences.wallmarks.generic.name = "Marks on Walls:";
|
||||
s_preferences.wallmarks.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_preferences.wallmarks.generic.callback = Preferences_Event;
|
||||
s_preferences.wallmarks.generic.id = ID_WALLMARKS;
|
||||
s_preferences.wallmarks.generic.x = PREFERENCES_X_POS;
|
||||
s_preferences.wallmarks.generic.y = y;
|
||||
|
||||
y += BIGCHAR_HEIGHT+2;
|
||||
s_preferences.brass.generic.type = MTYPE_RADIOBUTTON;
|
||||
s_preferences.brass.generic.name = "Ejecting Brass:";
|
||||
s_preferences.brass.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_preferences.brass.generic.callback = Preferences_Event;
|
||||
s_preferences.brass.generic.id = ID_EJECTINGBRASS;
|
||||
s_preferences.brass.generic.x = PREFERENCES_X_POS;
|
||||
s_preferences.brass.generic.y = y;
|
||||
|
||||
y += BIGCHAR_HEIGHT+2;
|
||||
s_preferences.dynamiclights.generic.type = MTYPE_RADIOBUTTON;
|
||||
s_preferences.dynamiclights.generic.name = "Dynamic Lights:";
|
||||
s_preferences.dynamiclights.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_preferences.dynamiclights.generic.callback = Preferences_Event;
|
||||
s_preferences.dynamiclights.generic.id = ID_DYNAMICLIGHTS;
|
||||
s_preferences.dynamiclights.generic.x = PREFERENCES_X_POS;
|
||||
s_preferences.dynamiclights.generic.y = y;
|
||||
|
||||
y += BIGCHAR_HEIGHT+2;
|
||||
s_preferences.identifytarget.generic.type = MTYPE_RADIOBUTTON;
|
||||
s_preferences.identifytarget.generic.name = "Identify Target:";
|
||||
s_preferences.identifytarget.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_preferences.identifytarget.generic.callback = Preferences_Event;
|
||||
s_preferences.identifytarget.generic.id = ID_IDENTIFYTARGET;
|
||||
s_preferences.identifytarget.generic.x = PREFERENCES_X_POS;
|
||||
s_preferences.identifytarget.generic.y = y;
|
||||
|
||||
y += BIGCHAR_HEIGHT+2;
|
||||
s_preferences.highqualitysky.generic.type = MTYPE_RADIOBUTTON;
|
||||
s_preferences.highqualitysky.generic.name = "High Quality Sky:";
|
||||
s_preferences.highqualitysky.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_preferences.highqualitysky.generic.callback = Preferences_Event;
|
||||
s_preferences.highqualitysky.generic.id = ID_HIGHQUALITYSKY;
|
||||
s_preferences.highqualitysky.generic.x = PREFERENCES_X_POS;
|
||||
s_preferences.highqualitysky.generic.y = y;
|
||||
|
||||
y += BIGCHAR_HEIGHT+2;
|
||||
s_preferences.synceveryframe.generic.type = MTYPE_RADIOBUTTON;
|
||||
s_preferences.synceveryframe.generic.name = "Sync Every Frame:";
|
||||
s_preferences.synceveryframe.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_preferences.synceveryframe.generic.callback = Preferences_Event;
|
||||
s_preferences.synceveryframe.generic.id = ID_SYNCEVERYFRAME;
|
||||
s_preferences.synceveryframe.generic.x = PREFERENCES_X_POS;
|
||||
s_preferences.synceveryframe.generic.y = y;
|
||||
|
||||
y += BIGCHAR_HEIGHT+2;
|
||||
s_preferences.forcemodel.generic.type = MTYPE_RADIOBUTTON;
|
||||
s_preferences.forcemodel.generic.name = "Force Player Models:";
|
||||
s_preferences.forcemodel.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_preferences.forcemodel.generic.callback = Preferences_Event;
|
||||
s_preferences.forcemodel.generic.id = ID_FORCEMODEL;
|
||||
s_preferences.forcemodel.generic.x = PREFERENCES_X_POS;
|
||||
s_preferences.forcemodel.generic.y = y;
|
||||
|
||||
y += BIGCHAR_HEIGHT+2;
|
||||
s_preferences.drawteamoverlay.generic.type = MTYPE_SPINCONTROL;
|
||||
s_preferences.drawteamoverlay.generic.name = "Draw Team Overlay:";
|
||||
s_preferences.drawteamoverlay.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_preferences.drawteamoverlay.generic.callback = Preferences_Event;
|
||||
s_preferences.drawteamoverlay.generic.id = ID_DRAWTEAMOVERLAY;
|
||||
s_preferences.drawteamoverlay.generic.x = PREFERENCES_X_POS;
|
||||
s_preferences.drawteamoverlay.generic.y = y;
|
||||
s_preferences.drawteamoverlay.itemnames = teamoverlay_names;
|
||||
|
||||
y += BIGCHAR_HEIGHT+2;
|
||||
s_preferences.allowdownload.generic.type = MTYPE_RADIOBUTTON;
|
||||
s_preferences.allowdownload.generic.name = "Automatic Downloading:";
|
||||
s_preferences.allowdownload.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_preferences.allowdownload.generic.callback = Preferences_Event;
|
||||
s_preferences.allowdownload.generic.id = ID_ALLOWDOWNLOAD;
|
||||
s_preferences.allowdownload.generic.x = PREFERENCES_X_POS;
|
||||
s_preferences.allowdownload.generic.y = y;
|
||||
|
||||
y += BIGCHAR_HEIGHT+2;
|
||||
s_preferences.back.generic.type = MTYPE_BITMAP;
|
||||
s_preferences.back.generic.name = ART_BACK0;
|
||||
s_preferences.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_preferences.back.generic.callback = Preferences_Event;
|
||||
s_preferences.back.generic.id = ID_BACK;
|
||||
s_preferences.back.generic.x = 0;
|
||||
s_preferences.back.generic.y = 480-64;
|
||||
s_preferences.back.width = 128;
|
||||
s_preferences.back.height = 64;
|
||||
s_preferences.back.focuspic = ART_BACK1;
|
||||
|
||||
Menu_AddItem( &s_preferences.menu, &s_preferences.banner );
|
||||
Menu_AddItem( &s_preferences.menu, &s_preferences.framel );
|
||||
Menu_AddItem( &s_preferences.menu, &s_preferences.framer );
|
||||
|
||||
Menu_AddItem( &s_preferences.menu, &s_preferences.crosshair );
|
||||
Menu_AddItem( &s_preferences.menu, &s_preferences.simpleitems );
|
||||
Menu_AddItem( &s_preferences.menu, &s_preferences.wallmarks );
|
||||
Menu_AddItem( &s_preferences.menu, &s_preferences.brass );
|
||||
Menu_AddItem( &s_preferences.menu, &s_preferences.dynamiclights );
|
||||
Menu_AddItem( &s_preferences.menu, &s_preferences.identifytarget );
|
||||
Menu_AddItem( &s_preferences.menu, &s_preferences.highqualitysky );
|
||||
Menu_AddItem( &s_preferences.menu, &s_preferences.synceveryframe );
|
||||
Menu_AddItem( &s_preferences.menu, &s_preferences.forcemodel );
|
||||
Menu_AddItem( &s_preferences.menu, &s_preferences.drawteamoverlay );
|
||||
Menu_AddItem( &s_preferences.menu, &s_preferences.allowdownload );
|
||||
|
||||
Menu_AddItem( &s_preferences.menu, &s_preferences.back );
|
||||
|
||||
Preferences_SetMenuItems();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
Preferences_Cache
|
||||
===============
|
||||
*/
|
||||
void Preferences_Cache( void ) {
|
||||
int n;
|
||||
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMEL );
|
||||
trap_R_RegisterShaderNoMip( ART_FRAMER );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK0 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK1 );
|
||||
for( n = 0; n < NUM_CROSSHAIRS; n++ ) {
|
||||
s_preferences.crosshairShader[n] = trap_R_RegisterShaderNoMip( va("gfx/2d/crosshair%c", 'a' + n ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_PreferencesMenu
|
||||
===============
|
||||
*/
|
||||
void UI_PreferencesMenu( void ) {
|
||||
Preferences_MenuInit();
|
||||
UI_PushMenu( &s_preferences.menu );
|
||||
}
|
||||
1726
code/q3_ui/.svn/text-base/ui_qmenu.c.svn-base
Executable file
1726
code/q3_ui/.svn/text-base/ui_qmenu.c.svn-base
Executable file
File diff suppressed because it is too large
Load Diff
400
code/q3_ui/.svn/text-base/ui_rankings.c.svn-base
Executable file
400
code/q3_ui/.svn/text-base/ui_rankings.c.svn-base
Executable file
@@ -0,0 +1,400 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
//
|
||||
// ui_rankings.c
|
||||
//
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define RANKINGS_FRAME "menu/art/cut_frame"
|
||||
|
||||
#define ID_LOGIN 100
|
||||
#define ID_LOGOUT 101
|
||||
#define ID_CREATE 102
|
||||
#define ID_SPECTATE 103
|
||||
#define ID_SETUP 104
|
||||
#define ID_LEAVE 105
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
menuframework_s menu;
|
||||
menubitmap_s frame;
|
||||
menutext_s login;
|
||||
menutext_s logout;
|
||||
menutext_s create;
|
||||
menutext_s spectate;
|
||||
menutext_s setup;
|
||||
menutext_s leave;
|
||||
} rankings_t;
|
||||
|
||||
static rankings_t s_rankings;
|
||||
|
||||
static menuframework_s s_rankings_menu;
|
||||
static menuaction_s s_rankings_login;
|
||||
static menuaction_s s_rankings_logout;
|
||||
static menuaction_s s_rankings_create;
|
||||
static menuaction_s s_rankings_spectate;
|
||||
static menuaction_s s_rankings_setup;
|
||||
static menuaction_s s_rankings_leave;
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
Rankings_DrawText
|
||||
===============
|
||||
*/
|
||||
void Rankings_DrawText( void* self )
|
||||
{
|
||||
menufield_s *f;
|
||||
qboolean focus;
|
||||
int style;
|
||||
char *txt;
|
||||
char c;
|
||||
float *color;
|
||||
int basex, x, y;
|
||||
|
||||
f = (menufield_s*)self;
|
||||
basex = f->generic.x;
|
||||
y = f->generic.y + 4;
|
||||
focus = (f->generic.parent->cursor == f->generic.menuPosition);
|
||||
|
||||
style = UI_LEFT|UI_SMALLFONT;
|
||||
color = text_color_normal;
|
||||
if( focus ) {
|
||||
style |= UI_PULSE;
|
||||
color = text_color_highlight;
|
||||
}
|
||||
|
||||
// draw the actual text
|
||||
txt = f->field.buffer;
|
||||
color = g_color_table[ColorIndex(COLOR_WHITE)];
|
||||
x = basex;
|
||||
while ( (c = *txt) != 0 ) {
|
||||
UI_DrawChar( x, y, c, style, color );
|
||||
txt++;
|
||||
x += SMALLCHAR_WIDTH;
|
||||
}
|
||||
|
||||
// draw cursor if we have focus
|
||||
if( focus ) {
|
||||
if ( trap_Key_GetOverstrikeMode() ) {
|
||||
c = 11;
|
||||
} else {
|
||||
c = 10;
|
||||
}
|
||||
|
||||
style &= ~UI_PULSE;
|
||||
style |= UI_BLINK;
|
||||
|
||||
UI_DrawChar( basex + f->field.cursor * SMALLCHAR_WIDTH, y, c, style, color_white );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
Rankings_DrawName
|
||||
===============
|
||||
*/
|
||||
void Rankings_DrawName( void* self )
|
||||
{
|
||||
menufield_s *f;
|
||||
int length;
|
||||
char* p;
|
||||
|
||||
f = (menufield_s*)self;
|
||||
|
||||
// GRANK_FIXME - enforce valid characters
|
||||
for( p = f->field.buffer; *p != '\0'; p++ )
|
||||
{
|
||||
//if( ispunct(*p) || isspace(*p) )
|
||||
if( !( ( (*p) >= '0' && (*p) <= '9') || Q_isalpha(*p)) )
|
||||
{
|
||||
*p = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
// strip color codes
|
||||
Q_CleanStr( f->field.buffer );
|
||||
length = strlen( f->field.buffer );
|
||||
if( f->field.cursor > length )
|
||||
{
|
||||
f->field.cursor = length;
|
||||
}
|
||||
|
||||
Rankings_DrawText( f );
|
||||
}
|
||||
|
||||
#if 0 // old version
|
||||
/*
|
||||
===============
|
||||
Rankings_DrawName
|
||||
===============
|
||||
*/
|
||||
void Rankings_DrawName( void* self )
|
||||
{
|
||||
menufield_s* f;
|
||||
int length;
|
||||
|
||||
f = (menufield_s*)self;
|
||||
|
||||
// strip color codes
|
||||
Q_CleanStr( f->field.buffer );
|
||||
length = strlen( f->field.buffer );
|
||||
if( f->field.cursor > length )
|
||||
{
|
||||
f->field.cursor = length;
|
||||
}
|
||||
|
||||
// show beginning of long names
|
||||
/*
|
||||
if( Menu_ItemAtCursor( f->generic.parent ) != f )
|
||||
{
|
||||
if( f->field.scroll > 0 )
|
||||
{
|
||||
f->field.cursor = 0;
|
||||
f->field.scroll = 0;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
MenuField_Draw( f );
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
===============
|
||||
Rankings_DrawPassword
|
||||
===============
|
||||
*/
|
||||
void Rankings_DrawPassword( void* self )
|
||||
{
|
||||
menufield_s* f;
|
||||
char password[MAX_EDIT_LINE];
|
||||
int length;
|
||||
int i;
|
||||
char* p;
|
||||
|
||||
f = (menufield_s*)self;
|
||||
|
||||
// GRANK_FIXME - enforce valid characters
|
||||
for( p = f->field.buffer; *p != '\0'; p++ )
|
||||
{
|
||||
//if( ispunct(*p) || isspace(*p) )
|
||||
if( !( ( (*p) >= '0' && (*p) <= '9') || Q_isalpha(*p)) )
|
||||
{
|
||||
*p = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
length = strlen( f->field.buffer );
|
||||
if( f->field.cursor > length )
|
||||
{
|
||||
f->field.cursor = length;
|
||||
}
|
||||
|
||||
// save password
|
||||
Q_strncpyz( password, f->field.buffer, sizeof(password) );
|
||||
|
||||
// mask password with *
|
||||
for( i = 0; i < length; i++ )
|
||||
{
|
||||
f->field.buffer[i] = '*';
|
||||
}
|
||||
|
||||
// draw masked password
|
||||
Rankings_DrawText( f );
|
||||
//MenuField_Draw( f );
|
||||
|
||||
// restore password
|
||||
Q_strncpyz( f->field.buffer, password, sizeof(f->field.buffer) );
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
Rankings_MenuEvent
|
||||
===============
|
||||
*/
|
||||
static void Rankings_MenuEvent( void* ptr, int event ) {
|
||||
if( event != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch( ((menucommon_s*)ptr)->id ) {
|
||||
case ID_LOGIN:
|
||||
UI_LoginMenu();
|
||||
break;
|
||||
|
||||
case ID_LOGOUT:
|
||||
// server side masqueraded player logout first
|
||||
trap_CL_UI_RankUserRequestLogout();
|
||||
UI_ForceMenuOff();
|
||||
break;
|
||||
|
||||
case ID_CREATE:
|
||||
UI_SignupMenu();
|
||||
break;
|
||||
|
||||
case ID_SPECTATE:
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, "cmd rank_spectate\n" );
|
||||
UI_ForceMenuOff();
|
||||
break;
|
||||
|
||||
case ID_SETUP:
|
||||
UI_SetupMenu();
|
||||
break;
|
||||
|
||||
case ID_LEAVE:
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, "disconnect\n" );
|
||||
UI_ForceMenuOff();
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
Rankings_MenuInit
|
||||
===============
|
||||
*/
|
||||
void Rankings_MenuInit( void ) {
|
||||
grank_status_t status;
|
||||
int y;
|
||||
|
||||
memset( &s_rankings, 0, sizeof(s_rankings) );
|
||||
|
||||
Rankings_Cache();
|
||||
|
||||
s_rankings.menu.wrapAround = qtrue;
|
||||
s_rankings.menu.fullscreen = qfalse;
|
||||
|
||||
s_rankings.frame.generic.type = MTYPE_BITMAP;
|
||||
s_rankings.frame.generic.flags = QMF_INACTIVE;
|
||||
s_rankings.frame.generic.name = RANKINGS_FRAME;
|
||||
s_rankings.frame.generic.x = 142;
|
||||
s_rankings.frame.generic.y = 118;
|
||||
s_rankings.frame.width = 359;
|
||||
s_rankings.frame.height = 256;
|
||||
|
||||
y = 194;
|
||||
|
||||
s_rankings.login.generic.type = MTYPE_PTEXT;
|
||||
s_rankings.login.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_rankings.login.generic.id = ID_LOGIN;
|
||||
s_rankings.login.generic.callback = Rankings_MenuEvent;
|
||||
s_rankings.login.generic.x = 320;
|
||||
s_rankings.login.generic.y = y;
|
||||
s_rankings.login.string = "LOGIN";
|
||||
s_rankings.login.style = UI_CENTER|UI_SMALLFONT;
|
||||
s_rankings.login.color = colorRed;
|
||||
y += 20;
|
||||
|
||||
s_rankings.logout.generic.type = MTYPE_PTEXT;
|
||||
s_rankings.logout.generic.flags = QMF_HIDDEN|QMF_INACTIVE|QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_rankings.logout.generic.id = ID_LOGOUT;
|
||||
s_rankings.logout.generic.callback = Rankings_MenuEvent;
|
||||
s_rankings.logout.generic.x = 320;
|
||||
s_rankings.logout.generic.y = y;
|
||||
s_rankings.logout.string = "LOGOUT";
|
||||
s_rankings.logout.style = UI_CENTER|UI_SMALLFONT;
|
||||
s_rankings.logout.color = colorRed;
|
||||
|
||||
s_rankings.create.generic.type = MTYPE_PTEXT;
|
||||
s_rankings.create.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_rankings.create.generic.id = ID_CREATE;
|
||||
s_rankings.create.generic.callback = Rankings_MenuEvent;
|
||||
s_rankings.create.generic.x = 320;
|
||||
s_rankings.create.generic.y = y;
|
||||
s_rankings.create.string = "SIGN UP";
|
||||
s_rankings.create.style = UI_CENTER|UI_SMALLFONT;
|
||||
s_rankings.create.color = colorRed;
|
||||
y += 20;
|
||||
|
||||
s_rankings.spectate.generic.type = MTYPE_PTEXT;
|
||||
s_rankings.spectate.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_rankings.spectate.generic.id = ID_SPECTATE;
|
||||
s_rankings.spectate.generic.callback = Rankings_MenuEvent;
|
||||
s_rankings.spectate.generic.x = 320;
|
||||
s_rankings.spectate.generic.y = y;
|
||||
s_rankings.spectate.string = "SPECTATE";
|
||||
s_rankings.spectate.style = UI_CENTER|UI_SMALLFONT;
|
||||
s_rankings.spectate.color = colorRed;
|
||||
y += 20;
|
||||
|
||||
s_rankings.setup.generic.type = MTYPE_PTEXT;
|
||||
s_rankings.setup.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_rankings.setup.generic.id = ID_SETUP;
|
||||
s_rankings.setup.generic.callback = Rankings_MenuEvent;
|
||||
s_rankings.setup.generic.x = 320;
|
||||
s_rankings.setup.generic.y = y;
|
||||
s_rankings.setup.string = "SETUP";
|
||||
s_rankings.setup.style = UI_CENTER|UI_SMALLFONT;
|
||||
s_rankings.setup.color = colorRed;
|
||||
y += 20;
|
||||
|
||||
s_rankings.leave.generic.type = MTYPE_PTEXT;
|
||||
s_rankings.leave.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_rankings.leave.generic.id = ID_LEAVE;
|
||||
s_rankings.leave.generic.callback = Rankings_MenuEvent;
|
||||
s_rankings.leave.generic.x = 320;
|
||||
s_rankings.leave.generic.y = y;
|
||||
s_rankings.leave.string = "LEAVE ARENA";
|
||||
s_rankings.leave.style = UI_CENTER|UI_SMALLFONT;
|
||||
s_rankings.leave.color = colorRed;
|
||||
y += 20;
|
||||
|
||||
status = (grank_status_t)trap_Cvar_VariableValue("client_status");
|
||||
if( (status != QGR_STATUS_NEW) && (status != QGR_STATUS_SPECTATOR) )
|
||||
{
|
||||
s_rankings.login.generic.flags |= QMF_HIDDEN | QMF_INACTIVE;
|
||||
s_rankings.create.generic.flags |= QMF_HIDDEN | QMF_INACTIVE;
|
||||
s_rankings.spectate.generic.flags |= QMF_HIDDEN | QMF_INACTIVE;
|
||||
|
||||
s_rankings.logout.generic.flags &= ~(QMF_HIDDEN | QMF_INACTIVE);
|
||||
}
|
||||
|
||||
if ( (status == QGR_STATUS_VALIDATING) ||
|
||||
(status == QGR_STATUS_PENDING) ||
|
||||
(status == QGR_STATUS_LEAVING) )
|
||||
{
|
||||
s_rankings.login.generic.flags |= QMF_GRAYED;
|
||||
s_rankings.create.generic.flags |= QMF_GRAYED;
|
||||
s_rankings.logout.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
|
||||
//GRank FIXME -- don't need setup option any more
|
||||
s_rankings.setup.generic.flags |= QMF_HIDDEN | QMF_INACTIVE;
|
||||
|
||||
Menu_AddItem( &s_rankings.menu, (void*) &s_rankings.frame );
|
||||
Menu_AddItem( &s_rankings.menu, (void*) &s_rankings.login );
|
||||
Menu_AddItem( &s_rankings.menu, (void*) &s_rankings.logout );
|
||||
Menu_AddItem( &s_rankings.menu, (void*) &s_rankings.create );
|
||||
Menu_AddItem( &s_rankings.menu, (void*) &s_rankings.spectate );
|
||||
Menu_AddItem( &s_rankings.menu, (void*) &s_rankings.setup );
|
||||
Menu_AddItem( &s_rankings.menu, (void*) &s_rankings.leave );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
Rankings_Cache
|
||||
===============
|
||||
*/
|
||||
void Rankings_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( RANKINGS_FRAME );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_RankingsMenu
|
||||
===============
|
||||
*/
|
||||
void UI_RankingsMenu( void ) {
|
||||
Rankings_MenuInit();
|
||||
UI_PushMenu ( &s_rankings.menu );
|
||||
}
|
||||
|
||||
|
||||
189
code/q3_ui/.svn/text-base/ui_rankstatus.c.svn-base
Executable file
189
code/q3_ui/.svn/text-base/ui_rankstatus.c.svn-base
Executable file
@@ -0,0 +1,189 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
//
|
||||
// ui_rankstatus.c
|
||||
//
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define RANKSTATUS_FRAME "menu/art/cut_frame"
|
||||
|
||||
#define ID_MESSAGE 100
|
||||
#define ID_OK 101
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
menuframework_s menu;
|
||||
menubitmap_s frame;
|
||||
menutext_s message;
|
||||
menutext_s ok;
|
||||
} rankstatus_t;
|
||||
|
||||
static rankstatus_t s_rankstatus;
|
||||
|
||||
static menuframework_s s_rankstatus_menu;
|
||||
static menuaction_s s_rankstatus_ok;
|
||||
|
||||
static grank_status_t s_status = 0;
|
||||
static char* s_rankstatus_message = NULL;
|
||||
|
||||
static vec4_t s_rankingstatus_color_prompt = {1.00, 0.43, 0.00, 1.00};
|
||||
|
||||
/*
|
||||
===============
|
||||
RankStatus_MenuEvent
|
||||
===============
|
||||
*/
|
||||
static void RankStatus_MenuEvent( void* ptr, int event ) {
|
||||
if( event != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch( ((menucommon_s*)ptr)->id ) {
|
||||
case ID_OK:
|
||||
UI_PopMenu();
|
||||
|
||||
switch( s_status )
|
||||
{
|
||||
case QGR_STATUS_NO_USER:
|
||||
UI_RankingsMenu();
|
||||
break;
|
||||
case QGR_STATUS_BAD_PASSWORD:
|
||||
UI_RankingsMenu();
|
||||
UI_LoginMenu();
|
||||
break;
|
||||
case QGR_STATUS_USER_EXISTS:
|
||||
UI_RankingsMenu();
|
||||
UI_SignupMenu();
|
||||
break;
|
||||
case QGR_STATUS_NO_MEMBERSHIP:
|
||||
UI_RankingsMenu();
|
||||
break;
|
||||
case QGR_STATUS_TIMEOUT:
|
||||
UI_RankingsMenu();
|
||||
break;
|
||||
case QGR_STATUS_INVALIDUSER:
|
||||
UI_RankingsMenu();
|
||||
break;
|
||||
case QGR_STATUS_ERROR:
|
||||
UI_RankingsMenu();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
RankStatus_MenuInit
|
||||
===============
|
||||
*/
|
||||
void RankStatus_MenuInit( void ) {
|
||||
int y;
|
||||
|
||||
memset( &s_rankstatus, 0, sizeof(s_rankstatus) );
|
||||
|
||||
RankStatus_Cache();
|
||||
|
||||
s_rankstatus.menu.wrapAround = qtrue;
|
||||
s_rankstatus.menu.fullscreen = qfalse;
|
||||
|
||||
s_rankstatus.frame.generic.type = MTYPE_BITMAP;
|
||||
s_rankstatus.frame.generic.flags = QMF_INACTIVE;
|
||||
s_rankstatus.frame.generic.name = RANKSTATUS_FRAME;
|
||||
s_rankstatus.frame.generic.x = 142; //320-233;
|
||||
s_rankstatus.frame.generic.y = 118; //240-166;
|
||||
s_rankstatus.frame.width = 359; //466;
|
||||
s_rankstatus.frame.height = 256; //332;
|
||||
|
||||
y = 214;
|
||||
|
||||
s_rankstatus.message.generic.type = MTYPE_PTEXT;
|
||||
s_rankstatus.message.generic.flags = QMF_CENTER_JUSTIFY|QMF_INACTIVE;
|
||||
s_rankstatus.message.generic.id = ID_MESSAGE;
|
||||
s_rankstatus.message.generic.x = 320;
|
||||
s_rankstatus.message.generic.y = y;
|
||||
s_rankstatus.message.string = s_rankstatus_message;
|
||||
s_rankstatus.message.style = UI_CENTER|UI_SMALLFONT;
|
||||
s_rankstatus.message.color = s_rankingstatus_color_prompt;
|
||||
y += 40;
|
||||
|
||||
s_rankstatus.ok.generic.type = MTYPE_PTEXT;
|
||||
s_rankstatus.ok.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_rankstatus.ok.generic.id = ID_OK;
|
||||
s_rankstatus.ok.generic.callback = RankStatus_MenuEvent;
|
||||
s_rankstatus.ok.generic.x = 320;
|
||||
s_rankstatus.ok.generic.y = y;
|
||||
s_rankstatus.ok.string = "OK";
|
||||
s_rankstatus.ok.style = UI_CENTER|UI_SMALLFONT;
|
||||
s_rankstatus.ok.color = colorRed;
|
||||
|
||||
Menu_AddItem( &s_rankstatus.menu, (void*) &s_rankstatus.frame );
|
||||
Menu_AddItem( &s_rankstatus.menu, (void*) &s_rankstatus.message );
|
||||
Menu_AddItem( &s_rankstatus.menu, (void*) &s_rankstatus.ok );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
RankStatus_Cache
|
||||
===============
|
||||
*/
|
||||
void RankStatus_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( RANKSTATUS_FRAME );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_RankStatusMenu
|
||||
===============
|
||||
*/
|
||||
void UI_RankStatusMenu( void ) {
|
||||
|
||||
s_status = (grank_status_t)trap_Cvar_VariableValue("client_status");
|
||||
|
||||
switch( s_status )
|
||||
{
|
||||
case QGR_STATUS_NEW:
|
||||
return;
|
||||
case QGR_STATUS_PENDING:
|
||||
// GRANK_FIXME
|
||||
return;
|
||||
case QGR_STATUS_NO_USER:
|
||||
// GRANK_FIXME - get this when user exists
|
||||
s_rankstatus_message = "Username unavailable";
|
||||
break;
|
||||
case QGR_STATUS_BAD_PASSWORD:
|
||||
s_rankstatus_message = "Invalid password";
|
||||
break;
|
||||
case QGR_STATUS_TIMEOUT:
|
||||
s_rankstatus_message = "Timed out";
|
||||
break;
|
||||
case QGR_STATUS_NO_MEMBERSHIP:
|
||||
s_rankstatus_message = "No membership";
|
||||
break;
|
||||
case QGR_STATUS_INVALIDUSER:
|
||||
s_rankstatus_message = "Validation failed";
|
||||
break;
|
||||
case QGR_STATUS_ERROR:
|
||||
s_rankstatus_message = "Error";
|
||||
break;
|
||||
case QGR_STATUS_SPECTATOR:
|
||||
case QGR_STATUS_ACTIVE:
|
||||
UI_ForceMenuOff();
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
RankStatus_MenuInit();
|
||||
trap_CL_UI_RankUserReset();
|
||||
UI_PushMenu ( &s_rankstatus.menu );
|
||||
}
|
||||
|
||||
322
code/q3_ui/.svn/text-base/ui_removebots.c.svn-base
Executable file
322
code/q3_ui/.svn/text-base/ui_removebots.c.svn-base
Executable file
@@ -0,0 +1,322 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
/*
|
||||
=======================================================================
|
||||
|
||||
REMOVE BOTS MENU
|
||||
|
||||
=======================================================================
|
||||
*/
|
||||
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define ART_BACKGROUND "menu/art/addbotframe"
|
||||
#define ART_BACK0 "menu/art/back_0"
|
||||
#define ART_BACK1 "menu/art/back_1"
|
||||
#define ART_DELETE0 "menu/art/delete_0"
|
||||
#define ART_DELETE1 "menu/art/delete_1"
|
||||
#define ART_ARROWS "menu/art/arrows_vert_0"
|
||||
#define ART_ARROWUP "menu/art/arrows_vert_top"
|
||||
#define ART_ARROWDOWN "menu/art/arrows_vert_bot"
|
||||
|
||||
#define ID_UP 10
|
||||
#define ID_DOWN 11
|
||||
#define ID_DELETE 12
|
||||
#define ID_BACK 13
|
||||
#define ID_BOTNAME0 20
|
||||
#define ID_BOTNAME1 21
|
||||
#define ID_BOTNAME2 22
|
||||
#define ID_BOTNAME3 23
|
||||
#define ID_BOTNAME4 24
|
||||
#define ID_BOTNAME5 25
|
||||
#define ID_BOTNAME6 26
|
||||
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
|
||||
menutext_s banner;
|
||||
menubitmap_s background;
|
||||
|
||||
menubitmap_s arrows;
|
||||
menubitmap_s up;
|
||||
menubitmap_s down;
|
||||
|
||||
menutext_s bots[7];
|
||||
|
||||
menubitmap_s delete;
|
||||
menubitmap_s back;
|
||||
|
||||
int numBots;
|
||||
int baseBotNum;
|
||||
int selectedBotNum;
|
||||
char botnames[7][32];
|
||||
int botClientNums[MAX_BOTS];
|
||||
} removeBotsMenuInfo_t;
|
||||
|
||||
static removeBotsMenuInfo_t removeBotsMenuInfo;
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_RemoveBotsMenu_SetBotNames
|
||||
=================
|
||||
*/
|
||||
static void UI_RemoveBotsMenu_SetBotNames( void ) {
|
||||
int n;
|
||||
char info[MAX_INFO_STRING];
|
||||
|
||||
for ( n = 0; (n < 7) && (removeBotsMenuInfo.baseBotNum + n < removeBotsMenuInfo.numBots); n++ ) {
|
||||
trap_GetConfigString( CS_PLAYERS + removeBotsMenuInfo.botClientNums[removeBotsMenuInfo.baseBotNum + n], info, MAX_INFO_STRING );
|
||||
Q_strncpyz( removeBotsMenuInfo.botnames[n], Info_ValueForKey( info, "n" ), sizeof(removeBotsMenuInfo.botnames[n]) );
|
||||
Q_CleanStr( removeBotsMenuInfo.botnames[n] );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_RemoveBotsMenu_DeleteEvent
|
||||
=================
|
||||
*/
|
||||
static void UI_RemoveBotsMenu_DeleteEvent( void* ptr, int event ) {
|
||||
if (event != QM_ACTIVATED) {
|
||||
return;
|
||||
}
|
||||
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va("clientkick %i\n", removeBotsMenuInfo.botClientNums[removeBotsMenuInfo.baseBotNum + removeBotsMenuInfo.selectedBotNum]) );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_RemoveBotsMenu_BotEvent
|
||||
=================
|
||||
*/
|
||||
static void UI_RemoveBotsMenu_BotEvent( void* ptr, int event ) {
|
||||
if (event != QM_ACTIVATED) {
|
||||
return;
|
||||
}
|
||||
|
||||
removeBotsMenuInfo.bots[removeBotsMenuInfo.selectedBotNum].color = color_orange;
|
||||
removeBotsMenuInfo.selectedBotNum = ((menucommon_s*)ptr)->id - ID_BOTNAME0;
|
||||
removeBotsMenuInfo.bots[removeBotsMenuInfo.selectedBotNum].color = color_white;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_RemoveAddBotsMenu_BackEvent
|
||||
=================
|
||||
*/
|
||||
static void UI_RemoveBotsMenu_BackEvent( void* ptr, int event ) {
|
||||
if (event != QM_ACTIVATED) {
|
||||
return;
|
||||
}
|
||||
UI_PopMenu();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_RemoveBotsMenu_UpEvent
|
||||
=================
|
||||
*/
|
||||
static void UI_RemoveBotsMenu_UpEvent( void* ptr, int event ) {
|
||||
if (event != QM_ACTIVATED) {
|
||||
return;
|
||||
}
|
||||
|
||||
if( removeBotsMenuInfo.baseBotNum > 0 ) {
|
||||
removeBotsMenuInfo.baseBotNum--;
|
||||
UI_RemoveBotsMenu_SetBotNames();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_RemoveBotsMenu_DownEvent
|
||||
=================
|
||||
*/
|
||||
static void UI_RemoveBotsMenu_DownEvent( void* ptr, int event ) {
|
||||
if (event != QM_ACTIVATED) {
|
||||
return;
|
||||
}
|
||||
|
||||
if( removeBotsMenuInfo.baseBotNum + 7 < removeBotsMenuInfo.numBots ) {
|
||||
removeBotsMenuInfo.baseBotNum++;
|
||||
UI_RemoveBotsMenu_SetBotNames();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_RemoveBotsMenu_GetBots
|
||||
=================
|
||||
*/
|
||||
static void UI_RemoveBotsMenu_GetBots( void ) {
|
||||
int numPlayers;
|
||||
int isBot;
|
||||
int n;
|
||||
char info[MAX_INFO_STRING];
|
||||
|
||||
trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) );
|
||||
numPlayers = atoi( Info_ValueForKey( info, "sv_maxclients" ) );
|
||||
removeBotsMenuInfo.numBots = 0;
|
||||
|
||||
for( n = 0; n < numPlayers; n++ ) {
|
||||
trap_GetConfigString( CS_PLAYERS + n, info, MAX_INFO_STRING );
|
||||
|
||||
isBot = atoi( Info_ValueForKey( info, "skill" ) );
|
||||
if( !isBot ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
removeBotsMenuInfo.botClientNums[removeBotsMenuInfo.numBots] = n;
|
||||
removeBotsMenuInfo.numBots++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_RemoveBots_Cache
|
||||
=================
|
||||
*/
|
||||
void UI_RemoveBots_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( ART_BACKGROUND );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK0 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK1 );
|
||||
trap_R_RegisterShaderNoMip( ART_DELETE0 );
|
||||
trap_R_RegisterShaderNoMip( ART_DELETE1 );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_RemoveBotsMenu_Init
|
||||
=================
|
||||
*/
|
||||
static void UI_RemoveBotsMenu_Init( void ) {
|
||||
int n;
|
||||
int count;
|
||||
int y;
|
||||
|
||||
memset( &removeBotsMenuInfo, 0 ,sizeof(removeBotsMenuInfo) );
|
||||
removeBotsMenuInfo.menu.fullscreen = qfalse;
|
||||
removeBotsMenuInfo.menu.wrapAround = qtrue;
|
||||
|
||||
UI_RemoveBots_Cache();
|
||||
|
||||
UI_RemoveBotsMenu_GetBots();
|
||||
UI_RemoveBotsMenu_SetBotNames();
|
||||
count = removeBotsMenuInfo.numBots < 7 ? removeBotsMenuInfo.numBots : 7;
|
||||
|
||||
removeBotsMenuInfo.banner.generic.type = MTYPE_BTEXT;
|
||||
removeBotsMenuInfo.banner.generic.x = 320;
|
||||
removeBotsMenuInfo.banner.generic.y = 16;
|
||||
removeBotsMenuInfo.banner.string = "REMOVE BOTS";
|
||||
removeBotsMenuInfo.banner.color = color_white;
|
||||
removeBotsMenuInfo.banner.style = UI_CENTER;
|
||||
|
||||
removeBotsMenuInfo.background.generic.type = MTYPE_BITMAP;
|
||||
removeBotsMenuInfo.background.generic.name = ART_BACKGROUND;
|
||||
removeBotsMenuInfo.background.generic.flags = QMF_INACTIVE;
|
||||
removeBotsMenuInfo.background.generic.x = 320-233;
|
||||
removeBotsMenuInfo.background.generic.y = 240-166;
|
||||
removeBotsMenuInfo.background.width = 466;
|
||||
removeBotsMenuInfo.background.height = 332;
|
||||
|
||||
removeBotsMenuInfo.arrows.generic.type = MTYPE_BITMAP;
|
||||
removeBotsMenuInfo.arrows.generic.name = ART_ARROWS;
|
||||
removeBotsMenuInfo.arrows.generic.flags = QMF_INACTIVE;
|
||||
removeBotsMenuInfo.arrows.generic.x = 200;
|
||||
removeBotsMenuInfo.arrows.generic.y = 128;
|
||||
removeBotsMenuInfo.arrows.width = 64;
|
||||
removeBotsMenuInfo.arrows.height = 128;
|
||||
|
||||
removeBotsMenuInfo.up.generic.type = MTYPE_BITMAP;
|
||||
removeBotsMenuInfo.up.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
removeBotsMenuInfo.up.generic.x = 200;
|
||||
removeBotsMenuInfo.up.generic.y = 128;
|
||||
removeBotsMenuInfo.up.generic.id = ID_UP;
|
||||
removeBotsMenuInfo.up.generic.callback = UI_RemoveBotsMenu_UpEvent;
|
||||
removeBotsMenuInfo.up.width = 64;
|
||||
removeBotsMenuInfo.up.height = 64;
|
||||
removeBotsMenuInfo.up.focuspic = ART_ARROWUP;
|
||||
|
||||
removeBotsMenuInfo.down.generic.type = MTYPE_BITMAP;
|
||||
removeBotsMenuInfo.down.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
removeBotsMenuInfo.down.generic.x = 200;
|
||||
removeBotsMenuInfo.down.generic.y = 128+64;
|
||||
removeBotsMenuInfo.down.generic.id = ID_DOWN;
|
||||
removeBotsMenuInfo.down.generic.callback = UI_RemoveBotsMenu_DownEvent;
|
||||
removeBotsMenuInfo.down.width = 64;
|
||||
removeBotsMenuInfo.down.height = 64;
|
||||
removeBotsMenuInfo.down.focuspic = ART_ARROWDOWN;
|
||||
|
||||
for( n = 0, y = 120; n < count; n++, y += 20 ) {
|
||||
removeBotsMenuInfo.bots[n].generic.type = MTYPE_PTEXT;
|
||||
removeBotsMenuInfo.bots[n].generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
removeBotsMenuInfo.bots[n].generic.id = ID_BOTNAME0 + n;
|
||||
removeBotsMenuInfo.bots[n].generic.x = 320 - 56;
|
||||
removeBotsMenuInfo.bots[n].generic.y = y;
|
||||
removeBotsMenuInfo.bots[n].generic.callback = UI_RemoveBotsMenu_BotEvent;
|
||||
removeBotsMenuInfo.bots[n].string = removeBotsMenuInfo.botnames[n];
|
||||
removeBotsMenuInfo.bots[n].color = color_orange;
|
||||
removeBotsMenuInfo.bots[n].style = UI_LEFT|UI_SMALLFONT;
|
||||
}
|
||||
|
||||
removeBotsMenuInfo.delete.generic.type = MTYPE_BITMAP;
|
||||
removeBotsMenuInfo.delete.generic.name = ART_DELETE0;
|
||||
removeBotsMenuInfo.delete.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
removeBotsMenuInfo.delete.generic.id = ID_DELETE;
|
||||
removeBotsMenuInfo.delete.generic.callback = UI_RemoveBotsMenu_DeleteEvent;
|
||||
removeBotsMenuInfo.delete.generic.x = 320+128-128;
|
||||
removeBotsMenuInfo.delete.generic.y = 256+128-64;
|
||||
removeBotsMenuInfo.delete.width = 128;
|
||||
removeBotsMenuInfo.delete.height = 64;
|
||||
removeBotsMenuInfo.delete.focuspic = ART_DELETE1;
|
||||
|
||||
removeBotsMenuInfo.back.generic.type = MTYPE_BITMAP;
|
||||
removeBotsMenuInfo.back.generic.name = ART_BACK0;
|
||||
removeBotsMenuInfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
removeBotsMenuInfo.back.generic.id = ID_BACK;
|
||||
removeBotsMenuInfo.back.generic.callback = UI_RemoveBotsMenu_BackEvent;
|
||||
removeBotsMenuInfo.back.generic.x = 320-128;
|
||||
removeBotsMenuInfo.back.generic.y = 256+128-64;
|
||||
removeBotsMenuInfo.back.width = 128;
|
||||
removeBotsMenuInfo.back.height = 64;
|
||||
removeBotsMenuInfo.back.focuspic = ART_BACK1;
|
||||
|
||||
Menu_AddItem( &removeBotsMenuInfo.menu, &removeBotsMenuInfo.background );
|
||||
Menu_AddItem( &removeBotsMenuInfo.menu, &removeBotsMenuInfo.banner );
|
||||
Menu_AddItem( &removeBotsMenuInfo.menu, &removeBotsMenuInfo.arrows );
|
||||
Menu_AddItem( &removeBotsMenuInfo.menu, &removeBotsMenuInfo.up );
|
||||
Menu_AddItem( &removeBotsMenuInfo.menu, &removeBotsMenuInfo.down );
|
||||
for( n = 0; n < count; n++ ) {
|
||||
Menu_AddItem( &removeBotsMenuInfo.menu, &removeBotsMenuInfo.bots[n] );
|
||||
}
|
||||
Menu_AddItem( &removeBotsMenuInfo.menu, &removeBotsMenuInfo.delete );
|
||||
Menu_AddItem( &removeBotsMenuInfo.menu, &removeBotsMenuInfo.back );
|
||||
|
||||
removeBotsMenuInfo.baseBotNum = 0;
|
||||
removeBotsMenuInfo.selectedBotNum = 0;
|
||||
removeBotsMenuInfo.bots[0].color = color_white;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_RemoveBotsMenu
|
||||
=================
|
||||
*/
|
||||
void UI_RemoveBotsMenu( void ) {
|
||||
UI_RemoveBotsMenu_Init();
|
||||
UI_PushMenu( &removeBotsMenuInfo.menu );
|
||||
}
|
||||
192
code/q3_ui/.svn/text-base/ui_saveconfig.c.svn-base
Executable file
192
code/q3_ui/.svn/text-base/ui_saveconfig.c.svn-base
Executable file
@@ -0,0 +1,192 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
SAVE CONFIG MENU
|
||||
|
||||
=============================================================================
|
||||
*/
|
||||
|
||||
#include "ui_local.h"
|
||||
|
||||
|
||||
#define ART_BACK0 "menu/art/back_0"
|
||||
#define ART_BACK1 "menu/art/back_1"
|
||||
#define ART_SAVE0 "menu/art/save_0"
|
||||
#define ART_SAVE1 "menu/art/save_1"
|
||||
#define ART_BACKGROUND "menu/art/cut_frame"
|
||||
|
||||
#define ID_NAME 10
|
||||
#define ID_BACK 11
|
||||
#define ID_SAVE 12
|
||||
|
||||
|
||||
typedef struct {
|
||||
menuframework_s menu;
|
||||
|
||||
menutext_s banner;
|
||||
menubitmap_s background;
|
||||
menufield_s savename;
|
||||
menubitmap_s back;
|
||||
menubitmap_s save;
|
||||
} saveConfig_t;
|
||||
|
||||
static saveConfig_t saveConfig;
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_SaveConfigMenu_BackEvent
|
||||
===============
|
||||
*/
|
||||
static void UI_SaveConfigMenu_BackEvent( void *ptr, int event ) {
|
||||
if( event != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
UI_PopMenu();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_SaveConfigMenu_SaveEvent
|
||||
===============
|
||||
*/
|
||||
static void UI_SaveConfigMenu_SaveEvent( void *ptr, int event ) {
|
||||
char configname[MAX_QPATH];
|
||||
|
||||
if( event != QM_ACTIVATED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if( !saveConfig.savename.field.buffer[0] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
COM_StripExtension(saveConfig.savename.field.buffer, configname );
|
||||
trap_Cmd_ExecuteText( EXEC_APPEND, va( "writeconfig %s.cfg\n", configname ) );
|
||||
UI_PopMenu();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_SaveConfigMenu_SavenameDraw
|
||||
===============
|
||||
*/
|
||||
static void UI_SaveConfigMenu_SavenameDraw( void *self ) {
|
||||
menufield_s *f;
|
||||
int style;
|
||||
float *color;
|
||||
|
||||
f = (menufield_s *)self;
|
||||
|
||||
if( f == Menu_ItemAtCursor( &saveConfig.menu ) ) {
|
||||
style = UI_LEFT|UI_PULSE|UI_SMALLFONT;
|
||||
color = text_color_highlight;
|
||||
}
|
||||
else {
|
||||
style = UI_LEFT|UI_SMALLFONT;
|
||||
color = colorRed;
|
||||
}
|
||||
|
||||
UI_DrawProportionalString( 320, 192, "Enter filename:", UI_CENTER|UI_SMALLFONT, color_orange );
|
||||
UI_FillRect( f->generic.x, f->generic.y, f->field.widthInChars*SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, colorBlack );
|
||||
MField_Draw( &f->field, f->generic.x, f->generic.y, style, color );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_SaveConfigMenu_Init
|
||||
=================
|
||||
*/
|
||||
static void UI_SaveConfigMenu_Init( void ) {
|
||||
memset( &saveConfig, 0, sizeof(saveConfig) );
|
||||
|
||||
UI_SaveConfigMenu_Cache();
|
||||
saveConfig.menu.wrapAround = qtrue;
|
||||
saveConfig.menu.fullscreen = qtrue;
|
||||
|
||||
saveConfig.banner.generic.type = MTYPE_BTEXT;
|
||||
saveConfig.banner.generic.x = 320;
|
||||
saveConfig.banner.generic.y = 16;
|
||||
saveConfig.banner.string = "SAVE CONFIG";
|
||||
saveConfig.banner.color = color_white;
|
||||
saveConfig.banner.style = UI_CENTER;
|
||||
|
||||
saveConfig.background.generic.type = MTYPE_BITMAP;
|
||||
saveConfig.background.generic.name = ART_BACKGROUND;
|
||||
saveConfig.background.generic.flags = QMF_INACTIVE;
|
||||
saveConfig.background.generic.x = 142;
|
||||
saveConfig.background.generic.y = 118;
|
||||
saveConfig.background.width = 359;
|
||||
saveConfig.background.height = 256;
|
||||
|
||||
saveConfig.savename.generic.type = MTYPE_FIELD;
|
||||
saveConfig.savename.generic.flags = QMF_NODEFAULTINIT|QMF_UPPERCASE;
|
||||
saveConfig.savename.generic.ownerdraw = UI_SaveConfigMenu_SavenameDraw;
|
||||
saveConfig.savename.field.widthInChars = 20;
|
||||
saveConfig.savename.field.maxchars = 20;
|
||||
saveConfig.savename.generic.x = 240;
|
||||
saveConfig.savename.generic.y = 155+72;
|
||||
saveConfig.savename.generic.left = 240;
|
||||
saveConfig.savename.generic.top = 155+72;
|
||||
saveConfig.savename.generic.right = 233 + 20*SMALLCHAR_WIDTH;
|
||||
saveConfig.savename.generic.bottom = 155+72 + SMALLCHAR_HEIGHT+2;
|
||||
|
||||
saveConfig.back.generic.type = MTYPE_BITMAP;
|
||||
saveConfig.back.generic.name = ART_BACK0;
|
||||
saveConfig.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
saveConfig.back.generic.id = ID_BACK;
|
||||
saveConfig.back.generic.callback = UI_SaveConfigMenu_BackEvent;
|
||||
saveConfig.back.generic.x = 0;
|
||||
saveConfig.back.generic.y = 480-64;
|
||||
saveConfig.back.width = 128;
|
||||
saveConfig.back.height = 64;
|
||||
saveConfig.back.focuspic = ART_BACK1;
|
||||
|
||||
saveConfig.save.generic.type = MTYPE_BITMAP;
|
||||
saveConfig.save.generic.name = ART_SAVE0;
|
||||
saveConfig.save.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
saveConfig.save.generic.id = ID_SAVE;
|
||||
saveConfig.save.generic.callback = UI_SaveConfigMenu_SaveEvent;
|
||||
saveConfig.save.generic.x = 640;
|
||||
saveConfig.save.generic.y = 480-64;
|
||||
saveConfig.save.width = 128;
|
||||
saveConfig.save.height = 64;
|
||||
saveConfig.save.focuspic = ART_SAVE1;
|
||||
|
||||
Menu_AddItem( &saveConfig.menu, &saveConfig.banner );
|
||||
Menu_AddItem( &saveConfig.menu, &saveConfig.background );
|
||||
Menu_AddItem( &saveConfig.menu, &saveConfig.savename );
|
||||
Menu_AddItem( &saveConfig.menu, &saveConfig.back );
|
||||
Menu_AddItem( &saveConfig.menu, &saveConfig.save );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_SaveConfigMenu_Cache
|
||||
=================
|
||||
*/
|
||||
void UI_SaveConfigMenu_Cache( void ) {
|
||||
trap_R_RegisterShaderNoMip( ART_BACK0 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACK1 );
|
||||
trap_R_RegisterShaderNoMip( ART_SAVE0 );
|
||||
trap_R_RegisterShaderNoMip( ART_SAVE1 );
|
||||
trap_R_RegisterShaderNoMip( ART_BACKGROUND );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
UI_SaveConfigMenu
|
||||
===============
|
||||
*/
|
||||
void UI_SaveConfigMenu( void ) {
|
||||
UI_SaveConfigMenu_Init();
|
||||
UI_PushMenu( &saveConfig.menu );
|
||||
}
|
||||
252
code/q3_ui/.svn/text-base/ui_serverinfo.c.svn-base
Executable file
252
code/q3_ui/.svn/text-base/ui_serverinfo.c.svn-base
Executable file
@@ -0,0 +1,252 @@
|
||||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
#include "ui_local.h"
|
||||
|
||||
#define SERVERINFO_FRAMEL "menu/art/frame2_l"
|
||||
#define SERVERINFO_FRAMER "menu/art/frame1_r"
|
||||
#define SERVERINFO_BACK0 "menu/art/back_0"
|
||||
#define SERVERINFO_BACK1 "menu/art/back_1"
|
||||
|
||||
static char* serverinfo_artlist[] =
|
||||
{
|
||||
SERVERINFO_FRAMEL,
|
||||
SERVERINFO_FRAMER,
|
||||
SERVERINFO_BACK0,
|
||||
SERVERINFO_BACK1,
|
||||
NULL
|
||||
};
|
||||
|
||||
#define ID_ADD 100
|
||||
#define ID_BACK 101
|
||||
|
||||
typedef struct
|
||||
{
|
||||
menuframework_s menu;
|
||||
menutext_s banner;
|
||||
menubitmap_s framel;
|
||||
menubitmap_s framer;
|
||||
menubitmap_s back;
|
||||
menutext_s add;
|
||||
char info[MAX_INFO_STRING];
|
||||
int numlines;
|
||||
} serverinfo_t;
|
||||
|
||||
static serverinfo_t s_serverinfo;
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
Favorites_Add
|
||||
|
||||
Add current server to favorites
|
||||
=================
|
||||
*/
|
||||
void Favorites_Add( void )
|
||||
{
|
||||
char adrstr[128];
|
||||
char serverbuff[128];
|
||||
int i;
|
||||
int best;
|
||||
|
||||
trap_Cvar_VariableStringBuffer( "cl_currentServerAddress", serverbuff, sizeof(serverbuff) );
|
||||
if (!serverbuff[0])
|
||||
return;
|
||||
|
||||
best = 0;
|
||||
for (i=0; i<MAX_FAVORITESERVERS; i++)
|
||||
{
|
||||
trap_Cvar_VariableStringBuffer( va("server%d",i+1), adrstr, sizeof(adrstr) );
|
||||
if (!Q_stricmp(serverbuff,adrstr))
|
||||
{
|
||||
// already in list
|
||||
return;
|
||||
}
|
||||
|
||||
// use first empty or non-numeric available slot
|
||||
if ((adrstr[0] < '0' || adrstr[0] > '9' ) && !best)
|
||||
best = i+1;
|
||||
}
|
||||
|
||||
if (best)
|
||||
trap_Cvar_Set( va("server%d",best), serverbuff);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
ServerInfo_Event
|
||||
=================
|
||||
*/
|
||||
static void ServerInfo_Event( void* ptr, int event )
|
||||
{
|
||||
switch (((menucommon_s*)ptr)->id)
|
||||
{
|
||||
case ID_ADD:
|
||||
if (event != QM_ACTIVATED)
|
||||
break;
|
||||
|
||||
Favorites_Add();
|
||||
UI_PopMenu();
|
||||
break;
|
||||
|
||||
case ID_BACK:
|
||||
if (event != QM_ACTIVATED)
|
||||
break;
|
||||
|
||||
UI_PopMenu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
ServerInfo_MenuDraw
|
||||
=================
|
||||
*/
|
||||
static void ServerInfo_MenuDraw( void )
|
||||
{
|
||||
const char *s;
|
||||
char key[MAX_INFO_KEY];
|
||||
char value[MAX_INFO_VALUE];
|
||||
int y;
|
||||
|
||||
y = SCREEN_HEIGHT/2 - s_serverinfo.numlines*(SMALLCHAR_HEIGHT)/2 - 20;
|
||||
s = s_serverinfo.info;
|
||||
while ( s ) {
|
||||
Info_NextPair( &s, key, value );
|
||||
if ( !key[0] ) {
|
||||
break;
|
||||
}
|
||||
|
||||
Q_strcat( key, MAX_INFO_KEY, ":" );
|
||||
|
||||
UI_DrawString(SCREEN_WIDTH*0.50 - 8,y,key,UI_RIGHT|UI_SMALLFONT,color_red);
|
||||
UI_DrawString(SCREEN_WIDTH*0.50 + 8,y,value,UI_LEFT|UI_SMALLFONT,text_color_normal);
|
||||
|
||||
y += SMALLCHAR_HEIGHT;
|
||||
}
|
||||
|
||||
Menu_Draw( &s_serverinfo.menu );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
ServerInfo_MenuKey
|
||||
=================
|
||||
*/
|
||||
static sfxHandle_t ServerInfo_MenuKey( int key )
|
||||
{
|
||||
return ( Menu_DefaultKey( &s_serverinfo.menu, key ) );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
ServerInfo_Cache
|
||||
=================
|
||||
*/
|
||||
void ServerInfo_Cache( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
// touch all our pics
|
||||
for (i=0; ;i++)
|
||||
{
|
||||
if (!serverinfo_artlist[i])
|
||||
break;
|
||||
trap_R_RegisterShaderNoMip(serverinfo_artlist[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
UI_ServerInfoMenu
|
||||
=================
|
||||
*/
|
||||
void UI_ServerInfoMenu( void )
|
||||
{
|
||||
const char *s;
|
||||
char key[MAX_INFO_KEY];
|
||||
char value[MAX_INFO_VALUE];
|
||||
|
||||
// zero set all our globals
|
||||
memset( &s_serverinfo, 0 ,sizeof(serverinfo_t) );
|
||||
|
||||
ServerInfo_Cache();
|
||||
|
||||
s_serverinfo.menu.draw = ServerInfo_MenuDraw;
|
||||
s_serverinfo.menu.key = ServerInfo_MenuKey;
|
||||
s_serverinfo.menu.wrapAround = qtrue;
|
||||
s_serverinfo.menu.fullscreen = qtrue;
|
||||
|
||||
s_serverinfo.banner.generic.type = MTYPE_BTEXT;
|
||||
s_serverinfo.banner.generic.x = 320;
|
||||
s_serverinfo.banner.generic.y = 16;
|
||||
s_serverinfo.banner.string = "SERVER INFO";
|
||||
s_serverinfo.banner.color = color_white;
|
||||
s_serverinfo.banner.style = UI_CENTER;
|
||||
|
||||
s_serverinfo.framel.generic.type = MTYPE_BITMAP;
|
||||
s_serverinfo.framel.generic.name = SERVERINFO_FRAMEL;
|
||||
s_serverinfo.framel.generic.flags = QMF_INACTIVE;
|
||||
s_serverinfo.framel.generic.x = 0;
|
||||
s_serverinfo.framel.generic.y = 78;
|
||||
s_serverinfo.framel.width = 256;
|
||||
s_serverinfo.framel.height = 329;
|
||||
|
||||
s_serverinfo.framer.generic.type = MTYPE_BITMAP;
|
||||
s_serverinfo.framer.generic.name = SERVERINFO_FRAMER;
|
||||
s_serverinfo.framer.generic.flags = QMF_INACTIVE;
|
||||
s_serverinfo.framer.generic.x = 376;
|
||||
s_serverinfo.framer.generic.y = 76;
|
||||
s_serverinfo.framer.width = 256;
|
||||
s_serverinfo.framer.height = 334;
|
||||
|
||||
s_serverinfo.add.generic.type = MTYPE_PTEXT;
|
||||
s_serverinfo.add.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_serverinfo.add.generic.callback = ServerInfo_Event;
|
||||
s_serverinfo.add.generic.id = ID_ADD;
|
||||
s_serverinfo.add.generic.x = 320;
|
||||
s_serverinfo.add.generic.y = 371;
|
||||
s_serverinfo.add.string = "ADD TO FAVORITES";
|
||||
s_serverinfo.add.style = UI_CENTER|UI_SMALLFONT;
|
||||
s_serverinfo.add.color = color_red;
|
||||
if( trap_Cvar_VariableValue( "sv_running" ) ) {
|
||||
s_serverinfo.add.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
|
||||
s_serverinfo.back.generic.type = MTYPE_BITMAP;
|
||||
s_serverinfo.back.generic.name = SERVERINFO_BACK0;
|
||||
s_serverinfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
|
||||
s_serverinfo.back.generic.callback = ServerInfo_Event;
|
||||
s_serverinfo.back.generic.id = ID_BACK;
|
||||
s_serverinfo.back.generic.x = 0;
|
||||
s_serverinfo.back.generic.y = 480-64;
|
||||
s_serverinfo.back.width = 128;
|
||||
s_serverinfo.back.height = 64;
|
||||
s_serverinfo.back.focuspic = SERVERINFO_BACK1;
|
||||
|
||||
trap_GetConfigString( CS_SERVERINFO, s_serverinfo.info, MAX_INFO_STRING );
|
||||
|
||||
s_serverinfo.numlines = 0;
|
||||
s = s_serverinfo.info;
|
||||
while ( s ) {
|
||||
Info_NextPair( &s, key, value );
|
||||
if ( !key[0] ) {
|
||||
break;
|
||||
}
|
||||
s_serverinfo.numlines++;
|
||||
}
|
||||
|
||||
if (s_serverinfo.numlines > 16)
|
||||
s_serverinfo.numlines = 16;
|
||||
|
||||
Menu_AddItem( &s_serverinfo.menu, (void*) &s_serverinfo.banner );
|
||||
Menu_AddItem( &s_serverinfo.menu, (void*) &s_serverinfo.framel );
|
||||
Menu_AddItem( &s_serverinfo.menu, (void*) &s_serverinfo.framer );
|
||||
Menu_AddItem( &s_serverinfo.menu, (void*) &s_serverinfo.add );
|
||||
Menu_AddItem( &s_serverinfo.menu, (void*) &s_serverinfo.back );
|
||||
|
||||
UI_PushMenu( &s_serverinfo.menu );
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user