diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas
index 2f6ce09122ea1f2daa5bb42d879b57949bd9fe90..2824c922d1b982d37d46c3f189be158c252eac86 100644 (file)
--- a/src/game/g_menu.pas
+++ b/src/game/g_menu.pas
procedure g_Menu_Init();
procedure g_Menu_Free();
procedure g_Menu_Reset();
procedure g_Menu_Init();
procedure g_Menu_Free();
procedure g_Menu_Reset();
-procedure LoadStdFont(cfgres, texture: string; var FontID: DWORD);
-procedure LoadFont(txtres, fntres: string; var FontID: DWORD);
procedure g_Menu_AskLanguage();
procedure g_Menu_Show_SaveMenu();
procedure g_Menu_AskLanguage();
procedure g_Menu_Show_SaveMenu();
procedure g_Menu_Show_QuitGameMenu();
var
procedure g_Menu_Show_QuitGameMenu();
var
- gMenuFont: DWORD;
- gMenuSmallFont: DWORD;
PromptIP: string;
PromptPort: Word;
TempScale: Integer = -1;
PromptIP: string;
PromptPort: Word;
TempScale: Integer = -1;
implementation
uses
implementation
uses
- {$INCLUDE ../nogl/noGLuses.inc}
- g_gui, g_textures, e_graphics, g_main, g_window, g_game, g_map,
- g_basic, g_console, g_sound, g_gfx, g_player, g_options, g_weapons,
+ g_gui, r_textures, r_graphics, g_game, g_map,
+ g_base, g_basic, g_console, g_sound, g_gfx, g_player, g_options, g_weapons,
e_log, SysUtils, CONFIG, g_playermodel, DateUtils,
MAPDEF, Math, g_saveload,
e_log, SysUtils, CONFIG, g_playermodel, DateUtils,
MAPDEF, Math, g_saveload,
- e_texture, g_language, e_res,
- g_net, g_netmsg, g_netmaster, g_items, e_input, g_touch,
- utils, wadreader, g_system;
+ g_language, e_res,
+ g_net, g_netmsg, g_netmaster, g_items, e_input,
+ utils, wadreader, g_system, r_render, r_game;
type TYNCallback = procedure (yes:Boolean);
type TYNCallback = procedure (yes:Boolean);
var
menu: TGUIMenu;
i: Integer;
var
menu: TGUIMenu;
i: Integer;
- ovs: Boolean;
begin
menu := TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
begin
menu := TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
else
gBPP := 32;
else
gBPP := 32;
- ovs := gVSync;
gVSync := TGUISwitch(menu.GetControl('swVSync')).ItemIndex = 0;
gVSync := TGUISwitch(menu.GetControl('swVSync')).ItemIndex = 0;
- if (ovs <> gVSync) then
- sys_EnableVSync(gVSync);
gTextureFilter := TGUISwitch(menu.GetControl('swTextureFilter')).ItemIndex = 0;
glNPOTOverride := not (TGUISwitch(menu.GetControl('swLegacyNPOT')).ItemIndex = 0);
gTextureFilter := TGUISwitch(menu.GetControl('swTextureFilter')).ItemIndex = 0;
glNPOTOverride := not (TGUISwitch(menu.GetControl('swLegacyNPOT')).ItemIndex = 0);
with menu do
begin
g_Console_BindKey(g_Console_FindBind(1, 'screenshot'), '');
with menu do
begin
g_Console_BindKey(g_Console_FindBind(1, 'screenshot'), '');
- g_Console_BindKey(g_Console_FindBind(1, '+p1_scores', '-p1_scores'), '');
+ g_Console_BindKey(g_Console_FindBind(1, '+scores', '-scores'), '');
g_Console_BindKey(g_Console_FindBind(1, 'togglechat'), '');
g_Console_BindKey(g_Console_FindBind(1, 'toggleteamchat'), '');
g_Console_BindKey(TGUIKeyRead(GetControl(_lc[I_MENU_CONTROL_SCREENSHOT])).Key, 'screenshot');
g_Console_BindKey(g_Console_FindBind(1, 'togglechat'), '');
g_Console_BindKey(g_Console_FindBind(1, 'toggleteamchat'), '');
g_Console_BindKey(TGUIKeyRead(GetControl(_lc[I_MENU_CONTROL_SCREENSHOT])).Key, 'screenshot');
- g_Console_BindKey(TGUIKeyRead(GetControl(_lc[I_MENU_CONTROL_STAT])).Key, '+p1_scores', '-p1_scores');
+ g_Console_BindKey(TGUIKeyRead(GetControl(_lc[I_MENU_CONTROL_STAT])).Key, '+scores', '-scores');
g_Console_BindKey(TGUIKeyRead(GetControl(_lc[I_MENU_CONTROL_CHAT])).Key, 'togglechat');
g_Console_BindKey(TGUIKeyRead(GetControl(_lc[I_MENU_CONTROL_TEAMCHAT])).Key, 'toggleteamchat');
end;
g_Console_BindKey(TGUIKeyRead(GetControl(_lc[I_MENU_CONTROL_CHAT])).Key, 'togglechat');
g_Console_BindKey(TGUIKeyRead(GetControl(_lc[I_MENU_CONTROL_TEAMCHAT])).Key, 'toggleteamchat');
end;
end;
menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
end;
menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
-
gPlayer1Settings.Name := b_Text_Unformat(TGUIEdit(menu.GetControl('edP1Name')).Text);
gPlayer1Settings.Team := IfThen(TGUISwitch(menu.GetControl('swP1Team')).ItemIndex = 0,
TEAM_RED, TEAM_BLUE);
gPlayer1Settings.Name := b_Text_Unformat(TGUIEdit(menu.GetControl('edP1Name')).Text);
gPlayer1Settings.Team := IfThen(TGUISwitch(menu.GetControl('swP1Team')).ItemIndex = 0,
TEAM_RED, TEAM_BLUE);
-
with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mvP1Model')) do
begin
with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mvP1Model')) do
begin
- gPlayer1Settings.Model := Model.Name;
+ gPlayer1Settings.Model := Model.GetName();
gPlayer1Settings.Color := Model.Color;
end;
gPlayer1Settings.Color := Model.Color;
end;
- menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
-
- gPlayer1Settings.Name := b_Text_Unformat(TGUIEdit(menu.GetControl('edP1Name')).Text);
- gPlayer1Settings.Team := IfThen(TGUISwitch(menu.GetControl('swP1Team')).ItemIndex = 0,
+ menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mOptionsPlayersP2Menu'));
+ gPlayer2Settings.Name := b_Text_Unformat(TGUIEdit(menu.GetControl('edP2Name')).Text);
+ gPlayer2Settings.Team := IfThen(TGUISwitch(menu.GetControl('swP2Team')).ItemIndex = 0,
TEAM_RED, TEAM_BLUE);
TEAM_RED, TEAM_BLUE);
-
- with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mvP1Model')) do
+ with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mvP2Model')) do
begin
begin
- gPlayer1Settings.Model := Model.Name;
- gPlayer1Settings.Color := Model.Color;
+ gPlayer2Settings.Model := Model.GetName();
+ gPlayer2Settings.Color := Model.Color;
end;
menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1WeaponMenu').GetControl('mOptionsPlayersP1WeaponMenu'));
end;
menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1WeaponMenu').GetControl('mOptionsPlayersP1WeaponMenu'));
- gPlayer1Settings.WeaponSwitch := TGUISwitch(menu.GetControl('swWeaponAutoswitch')).ItemIndex;
-
+ gPlayer1Settings.WeaponSwitch := TGUISwitch(menu.GetControl('swWeaponAutoswitch')).ItemIndex;
+ gPlayer1Settings.SwitchToEmpty := TGUISwitch(menu.GetControl('swWeaponAllowEmpty')).ItemIndex;
+ gPlayer1Settings.SkipFist := TGUISwitch(menu.GetControl('swWeaponAllowFist')).ItemIndex;
menu := TGUIMenu(g_GUI_GetWindow('OptionsPreferencesP1WeaponMenu').GetControl('mOptionsPreferencesP1WeaponMenu'));
with menu do
begin
menu := TGUIMenu(g_GUI_GetWindow('OptionsPreferencesP1WeaponMenu').GetControl('mOptionsPreferencesP1WeaponMenu'));
with menu do
begin
end;
menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2WeaponMenu').GetControl('mOptionsPlayersP2WeaponMenu'));
end;
menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2WeaponMenu').GetControl('mOptionsPlayersP2WeaponMenu'));
- gPlayer2Settings.WeaponSwitch := TGUISwitch(menu.GetControl('swWeaponAutoswitch')).ItemIndex;
-
+ gPlayer2Settings.WeaponSwitch := TGUISwitch(menu.GetControl('swWeaponAutoswitch')).ItemIndex;
+ gPlayer2Settings.SwitchToEmpty := TGUISwitch(menu.GetControl('swWeaponAllowEmpty')).ItemIndex;
+ gPlayer2Settings.SkipFist := TGUISwitch(menu.GetControl('swWeaponAllowFist')).ItemIndex;
menu := TGUIMenu(g_GUI_GetWindow('OptionsPreferencesP2WeaponMenu').GetControl('mOptionsPreferencesP2WeaponMenu'));
with menu do
begin
menu := TGUIMenu(g_GUI_GetWindow('OptionsPreferencesP2WeaponMenu').GetControl('mOptionsPreferencesP2WeaponMenu'));
with menu do
begin
end;
end;
end;
end;
- menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mOptionsPlayersP2Menu'));
-
- gPlayer2Settings.Name := b_Text_Unformat(TGUIEdit(menu.GetControl('edP2Name')).Text);
- gPlayer2Settings.Team := IfThen(TGUISwitch(menu.GetControl('swP2Team')).ItemIndex = 0,
- TEAM_RED, TEAM_BLUE);
- with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mvP2Model')) do
- begin
- gPlayer2Settings.Model := Model.Name;
- gPlayer2Settings.Color := Model.Color;
- end;
-
if gPlayer1Settings.Name = '' then gPlayer1Settings.Name := GenPlayerName(1);
if gPlayer2Settings.Name = '' then gPlayer2Settings.Name := GenPlayerName(2);
if gPlayer1Settings.Name = '' then gPlayer1Settings.Name := GenPlayerName(1);
if gPlayer2Settings.Name = '' then gPlayer2Settings.Name := GenPlayerName(2);
else
if gPlayer1.Team <> gPlayer1Settings.Team then
gPlayer1.SwitchTeam;
else
if gPlayer1.Team <> gPlayer1Settings.Team then
gPlayer1.SwitchTeam;
-
+ gPlayer1.WeapSwitchMode := gPlayer1Settings.WeaponSwitch;
+ gPlayer1.setWeaponPrefs(gPlayer1Settings.WeaponPreferences);
+ gPlayer1.SwitchToEmpty := gPlayer1Settings.SwitchToEmpty;
+ gPlayer1.SkipFist := gPlayer1Settings.SkipFist;
if g_Game_IsNet then MH_SEND_PlayerSettings(gPlayer1.UID);
end;
if g_Game_IsNet then MH_SEND_PlayerSettings(gPlayer1.UID);
end;
begin
gPlayer2.SetModel(gPlayer2Settings.Model);
gPlayer2.Name := gPlayer2Settings.Name;
begin
gPlayer2.SetModel(gPlayer2Settings.Model);
gPlayer2.Name := gPlayer2Settings.Name;
- if (gGameSettings.GameMode <> GM_TDM) and (gGameSettings.GameMode <> GM_CTF) then
+ if not (gGameSettings.GameMode in [GM_TDM, GM_CTF]) then
gPlayer2.SetColor(gPlayer2Settings.Color)
else
if gPlayer2.Team <> gPlayer2Settings.Team then
gPlayer2.SwitchTeam;
gPlayer2.SetColor(gPlayer2Settings.Color)
else
if gPlayer2.Team <> gPlayer2Settings.Team then
gPlayer2.SwitchTeam;
+ gPlayer2.WeapSwitchMode := gPlayer2Settings.WeaponSwitch;
+ gPlayer2.setWeaponPrefs(gPlayer2Settings.WeaponPreferences);
+ gPlayer2.SwitchToEmpty := gPlayer2Settings.SwitchToEmpty;
+ gPlayer2.SkipFist := gPlayer2Settings.SkipFist;
+ //if g_Game_IsNet then MH_SEND_PlayerSettings(gPlayer2.UID);
end;
end;
end;
end;
- if g_Game_IsClient then MC_SEND_PlayerSettings;
+ if g_Game_IsClient then
+ begin
+ MC_SEND_PlayerSettings;
+ gPlayer1.setWeaponPrefs(gPlayer1Settings.WeaponPreferences);
+ end;
g_Console_WriteGameConfig;
end;
g_Console_WriteGameConfig;
end;
procedure ReadOptions();
var
menu: TGUIMenu;
procedure ReadOptions();
var
menu: TGUIMenu;
- i, a: Integer;
+ i: Integer;
begin
menu := TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
begin
menu := TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
with menu do
begin
TGUIKeyRead(GetControl(_lc[I_MENU_CONTROL_SCREENSHOT])).Key := g_Console_FindBind(1, 'screenshot');
with menu do
begin
TGUIKeyRead(GetControl(_lc[I_MENU_CONTROL_SCREENSHOT])).Key := g_Console_FindBind(1, 'screenshot');
- TGUIKeyRead(GetControl(_lc[I_MENU_CONTROL_STAT])).Key := g_Console_FindBind(1, '+p1_scores', '-p1_scores');
+ TGUIKeyRead(GetControl(_lc[I_MENU_CONTROL_STAT])).Key := g_Console_FindBind(1, '+scores', '-scores');
TGUIKeyRead(GetControl(_lc[I_MENU_CONTROL_CHAT])).Key := g_Console_FindBind(1, 'togglechat');
TGUIKeyRead(GetControl(_lc[I_MENU_CONTROL_TEAMCHAT])).Key := g_Console_FindBind(1, 'toggleteamchat');
end;
TGUIKeyRead(GetControl(_lc[I_MENU_CONTROL_CHAT])).Key := g_Console_FindBind(1, 'togglechat');
TGUIKeyRead(GetControl(_lc[I_MENU_CONTROL_TEAMCHAT])).Key := g_Console_FindBind(1, 'toggleteamchat');
end;
menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1WeaponMenu').GetControl('mOptionsPlayersP1WeaponMenu'));
TGUISwitch(menu.GetControl('swWeaponAutoswitch')).ItemIndex := gPlayer1Settings.WeaponSwitch;
menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1WeaponMenu').GetControl('mOptionsPlayersP1WeaponMenu'));
TGUISwitch(menu.GetControl('swWeaponAutoswitch')).ItemIndex := gPlayer1Settings.WeaponSwitch;
-
+ TGUISwitch(menu.GetControl('swWeaponAllowEmpty')).ItemIndex := gPlayer1Settings.SwitchToEmpty;
+ TGUISwitch(menu.GetControl('swWeaponAllowFist')).ItemIndex := gPlayer1Settings.SkipFist;
menu := TGUIMenu(g_GUI_GetWindow('OptionsPreferencesP1WeaponMenu').GetControl('mOptionsPreferencesP1WeaponMenu'));
for i := WP_FIRST to WP_LAST+1 do
begin
menu := TGUIMenu(g_GUI_GetWindow('OptionsPreferencesP1WeaponMenu').GetControl('mOptionsPreferencesP1WeaponMenu'));
for i := WP_FIRST to WP_LAST+1 do
begin
menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2WeaponMenu').GetControl('mOptionsPlayersP2WeaponMenu'));
TGUISwitch(menu.GetControl('swWeaponAutoswitch')).ItemIndex := gPlayer2Settings.WeaponSwitch;
menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2WeaponMenu').GetControl('mOptionsPlayersP2WeaponMenu'));
TGUISwitch(menu.GetControl('swWeaponAutoswitch')).ItemIndex := gPlayer2Settings.WeaponSwitch;
-
+ TGUISwitch(menu.GetControl('swWeaponAllowEmpty')).ItemIndex := gPlayer2Settings.SwitchToEmpty;
+ TGUISwitch(menu.GetControl('swWeaponAllowFist')).ItemIndex := gPlayer2Settings.SkipFist;
menu := TGUIMenu(g_GUI_GetWindow('OptionsPreferencesP2WeaponMenu').GetControl('mOptionsPreferencesP2WeaponMenu'));
for i := WP_FIRST to WP_LAST+1 do
begin
menu := TGUIMenu(g_GUI_GetWindow('OptionsPreferencesP2WeaponMenu').GetControl('mOptionsPreferencesP2WeaponMenu'));
for i := WP_FIRST to WP_LAST+1 do
begin
Result := TGUISwitch(GetControl('swGameMode')).ItemIndex+1;
gsGameMode := TGUISwitch(GetControl('swGameMode')).GetText;
gsTimeLimit := StrToIntDef(TGUIEdit(GetControl('edTimeLimit')).Text, 0);
Result := TGUISwitch(GetControl('swGameMode')).ItemIndex+1;
gsGameMode := TGUISwitch(GetControl('swGameMode')).GetText;
gsTimeLimit := StrToIntDef(TGUIEdit(GetControl('edTimeLimit')).Text, 0);
- gsGoalLimit := StrToIntDef(TGUIEdit(GetControl('edGoalLimit')).Text, 0);
+ gsScoreLimit := StrToIntDef(TGUIEdit(GetControl('edScoreLimit')).Text, 0);
gsMaxLives := StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
gsItemRespawnTime := StrToIntDef(TGUIEdit(GetControl('edItemRespawnTime')).Text, 0);
gsPlayers := TGUISwitch(GetControl('swPlayers')).ItemIndex;
gsMaxLives := StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
gsItemRespawnTime := StrToIntDef(TGUIEdit(GetControl('edItemRespawnTime')).Text, 0);
gsPlayers := TGUISwitch(GetControl('swPlayers')).ItemIndex;
if GameMode = GM_NONE then Exit;
g_Console_WriteGameConfig;
if GameMode = GM_NONE then Exit;
g_Console_WriteGameConfig;
- g_Game_StartCustom(gsMap, GameMode, gsTimeLimit, gsGoalLimit,
+ g_Game_StartCustom(gsMap, GameMode, gsTimeLimit, gsScoreLimit,
gsMaxLives, gsGameFlags, gsPlayers);
end;
gsMaxLives, gsGameFlags, gsPlayers);
end;
end;
g_Console_WriteGameConfig;
end;
g_Console_WriteGameConfig;
- g_Game_StartServer(gsMap, GameMode, gsTimeLimit, gsGoalLimit, gsMaxLives,
+ g_Game_StartServer(gsMap, GameMode, gsTimeLimit, gsScoreLimit, gsMaxLives,
gsGameFlags, gsPlayers, 0, NetPort);
end;
gsGameFlags, gsPlayers, 0, NetPort);
end;
slWaitStr := _lc[I_NET_SLIST_WAIT];
slWaitStr := _lc[I_NET_SLIST_WAIT];
- g_Game_Draw;
+ r_Render_Draw;
sys_Repaint;
slReturnPressed := True;
sys_Repaint;
slReturnPressed := True;
ProcChangeColor(nil);
end;
ProcChangeColor(nil);
end;
-procedure LoadStdFont(cfgres, texture: string; var FontID: DWORD);
-var
- cwdt, chgt: Byte;
- spc: ShortInt;
- ID: DWORD;
- wad: TWADFile;
- cfgdata: Pointer;
- cfglen: Integer;
- config: TConfig;
-begin
- cfglen := 0;
-
- wad := TWADFile.Create;
- if wad.ReadFile(GameWAD) then
- wad.GetResource('FONTS/'+cfgres, cfgdata, cfglen);
- wad.Free();
-
- if cfglen <> 0 then
- begin
- g_Texture_CreateWADEx('FONT_STD', GameWAD+':FONTS\'+texture);
-
- config := TConfig.CreateMem(cfgdata, cfglen);
- cwdt := Min(Max(config.ReadInt('FontMap', 'CharWidth', 0), 0), 255);
- chgt := Min(Max(config.ReadInt('FontMap', 'CharHeight', 0), 0), 255);
- spc := Min(Max(config.ReadInt('FontMap', 'Kerning', 0), -128), 127);
-
- if g_Texture_Get('FONT_STD', ID) then
- e_TextureFontBuild(ID, FontID, cwdt, chgt, spc);
-
- config.Free();
- end;
-
- if cfglen <> 0 then FreeMem(cfgdata);
-end;
-
-procedure LoadFont(txtres, fntres: string; var FontID: DWORD);
-var
- cwdt, chgt: Byte;
- spc: ShortInt;
- CharID: DWORD;
- wad: TWADFile;
- cfgdata, fntdata: Pointer;
- cfglen, fntlen: Integer;
- config: TConfig;
- chrwidth: Integer;
- a: Byte;
-begin
- cfglen := 0;
- fntlen := 0;
-
- wad := TWADFile.Create;
- if wad.ReadFile(GameWAD) then
- begin
- wad.GetResource('FONTS/'+txtres, cfgdata, cfglen);
- wad.GetResource('FONTS/'+fntres, fntdata, fntlen);
- end;
- wad.Free();
-
- if cfglen <> 0 then
- begin
- config := TConfig.CreateMem(cfgdata, cfglen);
- cwdt := Min(Max(config.ReadInt('FontMap', 'CharWidth', 0), 0), 255);
- chgt := Min(Max(config.ReadInt('FontMap', 'CharHeight', 0), 0), 255);
-
- spc := Min(Max(config.ReadInt('FontMap', 'Kerning', 0), -128), 127);
- FontID := e_CharFont_Create(spc);
-
- for a := 0 to 255 do
- begin
- chrwidth := config.ReadInt(IntToStr(a), 'Width', 0);
- if chrwidth = 0 then Continue;
-
- if e_CreateTextureMemEx(fntdata, fntlen, CharID, cwdt*(a mod 16), chgt*(a div 16),
- cwdt, chgt) then
- e_CharFont_AddChar(FontID, CharID, Chr(a), chrwidth);
- end;
-
- config.Free();
- end;
-
- if cfglen <> 0 then FreeMem(cfgdata);
- if fntlen <> 0 then FreeMem(fntdata);
-end;
-
procedure MenuLoadData();
begin
e_WriteLog('Loading menu data...', TMsgType.Notify);
procedure MenuLoadData();
begin
e_WriteLog('Loading menu data...', TMsgType.Notify);
procedure ProcOptionsPlayersMIMenu();
var
s, a: string;
procedure ProcOptionsPlayersMIMenu();
var
s, a: string;
- b: TModelInfo;
+ i: Integer;
begin
if g_ActiveWindow.Name = 'OptionsPlayersP1Menu' then s := 'P1' else s := 'P2';
begin
if g_ActiveWindow.Name = 'OptionsPlayersP1Menu' then s := 'P1' else s := 'P2';
if a = '' then Exit;
if a = '' then Exit;
- b := g_PlayerModel_GetInfo(a);
-
+ i := g_PlayerModel_GetIndex(a);
with TGUIMenu(g_GUI_GetWindow('OptionsPlayersMIMenu').GetControl('mOptionsPlayersMIMenu')) do
begin
with TGUIMenu(g_GUI_GetWindow('OptionsPlayersMIMenu').GetControl('mOptionsPlayersMIMenu')) do
begin
- TGUILabel(GetControl('lbName')).Text := b.Name;
- TGUILabel(GetControl('lbAuthor')).Text := b.Author;
- TGUIMemo(GetControl('meComment')).SetText(b.Description);
+ TGUILabel(GetControl('lbName')).Text := PlayerModelsArray[i].Name;
+ TGUILabel(GetControl('lbAuthor')).Text := PlayerModelsArray[i].Author;
+ TGUIMemo(GetControl('meComment')).SetText(PlayerModelsArray[i].Description);
- if b.HaveWeapon then
+ if PlayerModelsArray[i].HaveWeapon then
TGUILabel(GetControl('lbWeapon')).Text := _lc[I_MENU_YES]
else
TGUILabel(GetControl('lbWeapon')).Text := _lc[I_MENU_NO];
TGUILabel(GetControl('lbWeapon')).Text := _lc[I_MENU_YES]
else
TGUILabel(GetControl('lbWeapon')).Text := _lc[I_MENU_NO];
with TGUIModelView(g_ActiveWindow.GetControl('mv'+s+'Model')) do
begin
NextAnim();
with TGUIModelView(g_ActiveWindow.GetControl('mv'+s+'Model')) do
begin
NextAnim();
- Model.GetCurrentAnimation.Loop := True;
- Model.GetCurrentAnimationMask.Loop := True;
+ Model.AnimState.Loop := True;
end;
end;
end;
end;
ItemIndex := 2;
TGUIEdit(menu.GetControl('edTimeLimit')).Text := IntToStr(TimeLimit);
ItemIndex := 2;
TGUIEdit(menu.GetControl('edTimeLimit')).Text := IntToStr(TimeLimit);
- TGUIEdit(menu.GetControl('edGoalLimit')).Text := IntToStr(GoalLimit);
+ TGUIEdit(menu.GetControl('edScoreLimit')).Text := IntToStr(ScoreLimit);
TGUIEdit(menu.GetControl('edMaxLives')).Text := IntToStr(MaxLives);
with TGUISwitch(menu.GetControl('swBotsVS')) do
TGUIEdit(menu.GetControl('edMaxLives')).Text := IntToStr(MaxLives);
with TGUISwitch(menu.GetControl('swBotsVS')) do
end;
TGUIEdit(menu.GetControl('edTimeLimit')).Enabled := True;
TGUILabel(menu.GetControlsText('edTimeLimit')).Color := MENU_ITEMSTEXT_COLOR;
end;
TGUIEdit(menu.GetControl('edTimeLimit')).Enabled := True;
TGUILabel(menu.GetControlsText('edTimeLimit')).Color := MENU_ITEMSTEXT_COLOR;
- TGUIEdit(menu.GetControl('edGoalLimit')).Enabled := True;
- TGUILabel(menu.GetControlsText('edGoalLimit')).Color := MENU_ITEMSTEXT_COLOR;
+ TGUIEdit(menu.GetControl('edScoreLimit')).Enabled := True;
+ TGUILabel(menu.GetControlsText('edScoreLimit')).Color := MENU_ITEMSTEXT_COLOR;
TGUIEdit(menu.GetControl('edMaxLives')).Enabled := True;
TGUILabel(menu.GetControlsText('edMaxLives')).Color := MENU_ITEMSTEXT_COLOR;
TGUISwitch(menu.GetControl('swBotsVS')).Enabled := True;
TGUIEdit(menu.GetControl('edMaxLives')).Enabled := True;
TGUILabel(menu.GetControlsText('edMaxLives')).Color := MENU_ITEMSTEXT_COLOR;
TGUISwitch(menu.GetControl('swBotsVS')).Enabled := True;
Text := '';
end;
TGUILabel(menu.GetControlsText('edTimeLimit')).Color := MENU_UNACTIVEITEMS_COLOR;
Text := '';
end;
TGUILabel(menu.GetControlsText('edTimeLimit')).Color := MENU_UNACTIVEITEMS_COLOR;
- with TGUIEdit(menu.GetControl('edGoalLimit')) do
+ with TGUIEdit(menu.GetControl('edScoreLimit')) do
begin
Enabled := False;
Text := '';
end;
begin
Enabled := False;
Text := '';
end;
- TGUILabel(menu.GetControlsText('edGoalLimit')).Color := MENU_UNACTIVEITEMS_COLOR;
+ TGUILabel(menu.GetControlsText('edScoreLimit')).Color := MENU_UNACTIVEITEMS_COLOR;
with TGUIEdit(menu.GetControl('edMaxLives')) do
begin
Enabled := False;
with TGUIEdit(menu.GetControl('edMaxLives')) do
begin
Enabled := False;
end;
end;
end;
end;
- if TGUIEdit(menu.GetControl('edGoalLimit')).Enabled then
+ if TGUIEdit(menu.GetControl('edScoreLimit')).Enabled then
begin
begin
- n := StrToIntDef(TGUIEdit(menu.GetControl('edGoalLimit')).Text, GoalLimit);
+ n := StrToIntDef(TGUIEdit(menu.GetControl('edScoreLimit')).Text, ScoreLimit);
if n = 0 then
if n = 0 then
- GoalLimit := 0
+ ScoreLimit := 0
else
begin
b := 0;
else
begin
b := 0;
b := stat[a].Frags;
end
else // CTF
b := stat[a].Frags;
end
else // CTF
- b := Max(gTeamStat[TEAM_RED].Goals, gTeamStat[TEAM_BLUE].Goals);
+ b := Max(gTeamStat[TEAM_RED].Score, gTeamStat[TEAM_BLUE].Score);
- GoalLimit := Max(n, b);
+ ScoreLimit := Max(n, b);
end;
end;
if TGUIEdit(menu.GetControl('edMaxLives')).Enabled then
begin
end;
end;
if TGUIEdit(menu.GetControl('edMaxLives')).Enabled then
begin
- n := StrToIntDef(TGUIEdit(menu.GetControl('edMaxLives')).Text, GoalLimit);
+ n := StrToIntDef(TGUIEdit(menu.GetControl('edMaxLives')).Text, MaxLives);
if n < 0 then n := 0;
if n > 255 then n := 255;
if n = 0 then
if n < 0 then n := 0;
if n > 255 then n := 255;
if n = 0 then
// don't forget to latch this shit
gsGameFlags := Options;
gsMaxLives := MaxLives;
// don't forget to latch this shit
gsGameFlags := Options;
gsMaxLives := MaxLives;
- gsGoalLimit := GoalLimit;
+ gsScoreLimit := ScoreLimit;
gsTimeLimit := TimeLimit;
end;
gsTimeLimit := TimeLimit;
end;
var
Menu: TGUIWindow;
//SR: TSearchRec;
var
Menu: TGUIWindow;
//SR: TSearchRec;
- a, cx, _y, i, x: Integer;
+ a, cx, _y, i: Integer;
//list: SSArray;
begin
Menu := TGUIWindow.Create('MainMenu');
//list: SSArray;
begin
Menu := TGUIWindow.Create('MainMenu');
Name := 'mmNewGameMenu';
AddButton(@ProcSingle1Player, _lc[I_MENU_1_PLAYER]);
AddButton(@ProcSingle2Players, _lc[I_MENU_2_PLAYERS]);
Name := 'mmNewGameMenu';
AddButton(@ProcSingle1Player, _lc[I_MENU_1_PLAYER]);
AddButton(@ProcSingle2Players, _lc[I_MENU_2_PLAYERS]);
- AddButton(nil, _lc[I_MENU_CUSTOM_GAME], 'CustomGameMenu');
AddButton(@ProcSelectCampaignMenu, _lc[I_MENU_CAMPAIGN], 'CampaignMenu');
AddButton(@ProcSelectCampaignMenu, _lc[I_MENU_CAMPAIGN], 'CampaignMenu');
+ AddButton(nil, _lc[I_MENU_CUSTOM_GAME], 'CustomGameMenu');
end;
Menu.DefControl := 'mmNewGameMenu';
g_GUI_AddWindow(Menu);
end;
Menu.DefControl := 'mmNewGameMenu';
g_GUI_AddWindow(Menu);
if gsTimeLimit > 0 then
Text := IntToStr(gsTimeLimit);
end;
if gsTimeLimit > 0 then
Text := IntToStr(gsTimeLimit);
end;
- with AddEdit(_lc[I_MENU_GOAL_LIMIT]) do
+ with AddEdit(_lc[I_MENU_SCORE_LIMIT]) do
begin
begin
- Name := 'edGoalLimit';
+ Name := 'edScoreLimit';
OnlyDigits := True;
Width := 4;
MaxLength := 5;
OnlyDigits := True;
Width := 4;
MaxLength := 5;
- if gsGoalLimit > 0 then
- Text := IntToStr(gsGoalLimit);
+ if gsScoreLimit > 0 then
+ Text := IntToStr(gsScoreLimit);
end;
with AddEdit(_lc[I_MENU_MAX_LIVES]) do
begin
end;
with AddEdit(_lc[I_MENU_MAX_LIVES]) do
begin
if gsTimeLimit > 0 then
Text := IntToStr(gsTimeLimit);
end;
if gsTimeLimit > 0 then
Text := IntToStr(gsTimeLimit);
end;
- with AddEdit(_lc[I_MENU_GOAL_LIMIT]) do
+ with AddEdit(_lc[I_MENU_SCORE_LIMIT]) do
begin
begin
- Name := 'edGoalLimit';
+ Name := 'edScoreLimit';
OnlyDigits := True;
Width := 4;
MaxLength := 5;
OnlyDigits := True;
Width := 4;
MaxLength := 5;
- if gsGoalLimit > 0 then
- Text := IntToStr(gsGoalLimit);
+ if gsScoreLimit > 0 then
+ Text := IntToStr(gsScoreLimit);
end;
with AddEdit(_lc[I_MENU_MAX_LIVES]) do
begin
end;
with AddEdit(_lc[I_MENU_MAX_LIVES]) do
begin
FixedLength := 10;
Enabled := False;
end;
FixedLength := 10;
Enabled := False;
end;
- with AddMemo(_lc[I_MENU_MAP_DESCRIPTION], 12, 4) do
+ with AddMemo(_lc[I_MENU_MAP_DESCRIPTION], 20, 4) do
begin
Name := 'meMapDescription';
end;
begin
Name := 'meMapDescription';
end;
AddItem(_lc[I_MENU_WEAPON_SWITCH_LINEAR]);
AddItem(_lc[I_MENU_WEAPON_SWITCH_PREFERENCE]);
end;
AddItem(_lc[I_MENU_WEAPON_SWITCH_LINEAR]);
AddItem(_lc[I_MENU_WEAPON_SWITCH_PREFERENCE]);
end;
+ with AddSwitch(_lc[I_MENU_WEAPON_ALLOW_EMPTY]) do
+ begin
+ Name := 'swWeaponAllowEmpty';
+ AddItem(_lc[I_MENU_YES]);
+ AddItem(_lc[I_MENU_NO]);
+ end;
+ with AddSwitch(_lc[I_MENU_KASTET_ALLOW]) do
+ begin
+ Name := 'swWeaponAllowFist';
+ AddItem(_lc[I_MENU_KASTET_ALLOW_ALWAYS]);
+ AddItem(_lc[I_MENU_KASTET_ALLOW_BERSERK]);
+ end;
AddButton(@ProcOptionsPlayerP1WeaponPreferencesMenu, _lc[I_MENU_WEAPON_SWITCH_PRIORITY]);
ReAlign();
end;
AddButton(@ProcOptionsPlayerP1WeaponPreferencesMenu, _lc[I_MENU_WEAPON_SWITCH_PRIORITY]);
ReAlign();
end;
AddItem(_lc[I_MENU_WEAPON_SWITCH_LINEAR]);
AddItem(_lc[I_MENU_WEAPON_SWITCH_PREFERENCE]);
end;
AddItem(_lc[I_MENU_WEAPON_SWITCH_LINEAR]);
AddItem(_lc[I_MENU_WEAPON_SWITCH_PREFERENCE]);
end;
+ with AddSwitch(_lc[I_MENU_WEAPON_ALLOW_EMPTY]) do
+ begin
+ Name := 'swWeaponAllowEmpty';
+ AddItem(_lc[I_MENU_YES]);
+ AddItem(_lc[I_MENU_NO]);
+ end;
+ with AddSwitch(_lc[I_MENU_KASTET_ALLOW]) do
+ begin
+ Name := 'swWeaponAllowFist';
+ AddItem(_lc[I_MENU_KASTET_ALLOW_ALWAYS]);
+ AddItem(_lc[I_MENU_KASTET_ALLOW_BERSERK]);
+ end;
AddButton(@ProcOptionsPlayerP2WeaponPreferencesMenu, _lc[I_MENU_WEAPON_SWITCH_PRIORITY]);
ReAlign();
end;
AddButton(@ProcOptionsPlayerP2WeaponPreferencesMenu, _lc[I_MENU_WEAPON_SWITCH_PRIORITY]);
ReAlign();
end;
Width := 4;
MaxLength := 5;
end;
Width := 4;
MaxLength := 5;
end;
- with AddEdit(_lc[I_MENU_GOAL_LIMIT]) do
+ with AddEdit(_lc[I_MENU_SCORE_LIMIT]) do
begin
begin
- Name := 'edGoalLimit';
+ Name := 'edScoreLimit';
OnlyDigits := True;
Width := 4;
MaxLength := 5;
OnlyDigits := True;
Width := 4;
MaxLength := 5;
procedure g_Menu_Init();
begin
MenuLoadData();
procedure g_Menu_Init();
begin
MenuLoadData();
- g_GUI_Init();
CreateAllMenus();
end;
procedure g_Menu_Free();
begin
CreateAllMenus();
end;
procedure g_Menu_Free();
begin
- g_GUI_Destroy();
-
- e_WriteLog('Releasing menu data...', TMsgType.Notify);
-
MenuFreeData();
end;
MenuFreeData();
end;