Cheat menu

This commit is contained in:
Petr Bartos 2023-09-30 14:27:05 +02:00
parent a0730801a5
commit e8e72601e5
6 changed files with 4244 additions and 4 deletions

View file

@ -100,10 +100,10 @@ CheatsOk
==================
*/
qboolean CheatsOk( gentity_t *ent ) {
if ( !g_cheats.integer ) {
trap_SendServerCommand( ent - g_entities, va( "print \"Cheats are not enabled on this server.\n\"" ) );
return qfalse;
}
//if ( !g_cheats.integer ) {
// trap_SendServerCommand( ent - g_entities, va( "print \"Cheats are not enabled on this server.\n\"" ) );
// return qfalse;
//}
if ( ent->health <= 0 ) {
trap_SendServerCommand( ent - g_entities, va( "print \"You must be alive to use this command.\n\"" ) );
return qfalse;

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -0,0 +1,149 @@
#include "ui/menudef.h"
{
menuDef {
name "cheats"
visible 0
fullscreen 0
rect 0 0 640 480
focusColor 1 .75 0 1
style 1
border 1
onOpen { play "sound/notebook/book_open.wav" }
onESC { play "sound/notebook/book_close.wav" }
itemDef {
name background
rect 20 30 600 420 // centered
style WINDOW_STYLE_SHADER
background "notebook1"
forecolor 0 0 0 1
visible 1
decoration
}
itemDef {
name button_close
text "Close"
type 1
textscale .25
group grpControlbutton
type ITEM_TYPE_BUTTON
style WINDOW_STYLE_SHADER
background "ui/assets/bookmark_back.tga"
rect 400 436 64 34
textalign 1
textalignx 32
textaligny 30
forecolor 1 1 1 .7
backcolor .3 .3 .3 1
visible 1
action { close cheats; open notebook }
mouseEnter { setitemcolor button_close backcolor .1 .37 .1 1 }
mouseExit { setitemcolor button_close backcolor .37 .1 .1 1 }
}
itemDef {
name sketch
group page
style WINDOW_STYLE_SHADER
background "ui/assets/cheats_sketch.tga"
rect 340 110 256 256
textalign 1
textalignx 32
textaligny 30
forecolor 1 1 1 .7
backcolor .3 .3 .3 1
visible 1
decoration
}
itemDef {
name title
group page
rect 64 72 240 30
text "PRIVATE BUCKET LIST:"
textfont UI_FONT_HANDWRITING
textscale .3
forecolor .1 .1 .1 .75
visible 1
decoration
}
itemDef {
name heal
group page
rect 64 105 200 20
type ITEM_TYPE_BUTTON
style WINDOW_STYLE_EMPTY
text "> Heal all wounds"
textfont UI_FONT_HANDWRITING
textscale .3
textaligny 15
forecolor .1 .1 .1 .75
visible 1
action { play "sound/notebook/book_pageflip.wav"; exec "give health 100;" }
}
itemDef {
name armor
group page
rect 64 135 240 20
type ITEM_TYPE_BUTTON
style WINDOW_STYLE_EMPTY
text "> Patch the armor"
textfont UI_FONT_HANDWRITING
textscale .3
textaligny 15
forecolor .1 .1 .1 .75
visible 1
action { play "sound/notebook/book_pageflip.wav"; exec "give armor 100;" }
}
itemDef {
name ammo
group page
rect 64 165 240 20
type ITEM_TYPE_BUTTON
style WINDOW_STYLE_EMPTY
text "> Scavenge some ammo"
textfont UI_FONT_HANDWRITING
textscale .3
textaligny 15
forecolor .1 .1 .1 .75
visible 1
action { play "sound/notebook/book_pageflip.wav"; exec "give ammo;" }
}
itemDef {
name ammo
group page
rect 64 195 240 20
type ITEM_TYPE_BUTTON
style WINDOW_STYLE_EMPTY
text "> Get armed to the teeth"
textfont UI_FONT_HANDWRITING
textscale .3
textaligny 15
forecolor .1 .1 .1 .75
visible 1
action { play "sound/notebook/book_pageflip.wav"; exec "give all;" }
}
itemDef {
name ammo
group page
rect 64 225 240 20
type ITEM_TYPE_BUTTON
style WINDOW_STYLE_EMPTY
text "> Just feel like running"
textfont UI_FONT_HANDWRITING
textscale .3
textaligny 15
forecolor .1 .1 .1 .75
visible 1
action { play "sound/notebook/book_pageflip.wav"; exec "nofatigue;" }
}
} // end menudef
} // end all

View file

@ -0,0 +1,29 @@
// menu defs
//
{
loadMenu { "ui/ingame.menu" }
// loadMenu { "ui/ingame_about.menu" }
loadMenu { "ui/ingame_controls.menu" }
loadMenu { "ui/ingame_options.menu" }
loadMenu { "ui/ingame_system.menu" }
loadMenu { "ui/ingame_leave.menu" }
loadMenu { "ui/ingame_player.menu" }
loadMenu { "ui/ingame_load.menu" }
loadMenu { "ui/ingame_save.menu" }
loadMenu { "ui/in_vid_restart.menu" }
loadMenu { "ui/in_snd_restart.menu" }
loadMenu { "ui/in_rec_restart.menu" }
loadMenu { "ui/notebook.menu" }
loadMenu { "ui/clipboard.menu" }
loadMenu { "ui/bookz.menu" }
loadMenu { "ui/bookv.menu" }
loadMenu { "ui/bookp.menu" }
loadMenu { "ui/pregame.menu" }
loadMenu { "ui/test.menu" }
loadMenu { "ui/ingame_help.menu" }
loadMenu { "ui/cheats.menu" }
}

File diff suppressed because it is too large Load diff