forked from ddnet/ddnet
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move chillerbot settings to own file
- Loading branch information
1 parent
39fd0e8
commit cc57ce3
Showing
3 changed files
with
157 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ | ||
/* If you are missing that file, acquire a complete release at teeworlds.com. */ | ||
#include <base/log.h> | ||
#include <base/math.h> | ||
#include <base/system.h> | ||
|
||
#include <engine/graphics.h> | ||
#include <engine/shared/config.h> | ||
#include <engine/shared/linereader.h> | ||
#include <engine/shared/localization.h> | ||
#include <engine/shared/protocol7.h> | ||
#include <engine/storage.h> | ||
#include <engine/textrender.h> | ||
#include <engine/updater.h> | ||
|
||
#include <game/generated/protocol.h> | ||
|
||
#include <game/client/animstate.h> | ||
#include <game/client/components/chat.h> | ||
#include <game/client/components/menu_background.h> | ||
#include <game/client/components/sounds.h> | ||
#include <game/client/gameclient.h> | ||
#include <game/client/render.h> | ||
#include <game/client/skin.h> | ||
#include <game/client/ui.h> | ||
#include <game/client/ui_listbox.h> | ||
#include <game/client/ui_scrollregion.h> | ||
#include <game/localization.h> | ||
|
||
#include <game/client/components/chillerbot/chillerbotux.h> | ||
#include <game/client/components/chillerbot/warlist.h> | ||
|
||
#include "menus.h" | ||
|
||
using namespace FontIcons; | ||
using namespace std::chrono_literals; | ||
|
||
|
||
void CMenus::RenderSettingsChillerbot(CUIRect MainView) | ||
{ | ||
CUIRect Button, Label; | ||
MainView.HSplitTop(10.0f, 0, &MainView); | ||
|
||
char aBuf[128]; | ||
|
||
// finish name | ||
{ | ||
CUIRect Checkbox; | ||
MainView.HSplitTop(20.0f, &Button, &MainView); | ||
Button.VSplitLeft(120.0f, &Label, &Button); | ||
Button.VSplitLeft(200.0f, &Button, &Checkbox); | ||
Button.VSplitLeft(150.0f, &Button, 0); | ||
str_format(aBuf, sizeof(aBuf), "%s:", "Finish name"); | ||
Ui()->DoLabel(&Label, aBuf, 14.0f, -1); | ||
static CLineInput s_NameInput; | ||
s_NameInput.SetBuffer(g_Config.m_ClFinishName, sizeof(g_Config.m_ClFinishName)); | ||
s_NameInput.SetEmptyText("chillerbot-ux"); | ||
Ui()->DoEditBox(&s_NameInput, &Button, 14.0f); | ||
if(DoButton_CheckBox(&g_Config.m_ClFinishRename, "Rename on finish", g_Config.m_ClFinishRename, &Checkbox)) | ||
{ | ||
g_Config.m_ClFinishRename ^= 1; | ||
m_pClient->m_ChillerBotUX.UpdateComponents(); | ||
} | ||
} | ||
|
||
MainView.HSplitTop(5.0f, 0, &MainView); | ||
|
||
// auto reply | ||
{ | ||
CUIRect Checkbox; | ||
MainView.HSplitTop(20.0f, &Button, &MainView); | ||
Button.VSplitLeft(120.0f, &Label, &Button); | ||
Button.VSplitLeft(200.0f, &Button, &Checkbox); | ||
Button.VSplitLeft(150.0f, &Button, 0); | ||
str_format(aBuf, sizeof(aBuf), "%s:", "auto reply msg"); | ||
Ui()->DoLabel(&Label, aBuf, 14.0f, -1); | ||
static CLineInput s_ReplyMsg; | ||
s_ReplyMsg.SetBuffer(g_Config.m_ClAutoReplyMsg, sizeof(g_Config.m_ClAutoReplyMsg)); | ||
s_ReplyMsg.SetEmptyText("I use chillerbot-ux"); | ||
Ui()->DoEditBox(&s_ReplyMsg, &Button, 14.0f); | ||
if(DoButton_CheckBox(&g_Config.m_ClAutoReply, "Auto reply", g_Config.m_ClAutoReply, &Checkbox)) | ||
{ | ||
g_Config.m_ClAutoReply ^= 1; | ||
m_pClient->m_ChillerBotUX.UpdateComponents(); | ||
} | ||
} | ||
|
||
MainView.HSplitTop(5.0f, 0, &MainView); | ||
|
||
// chillerbot hud | ||
{ | ||
CUIRect Checkbox; | ||
MainView.HSplitTop(20.0f, &Checkbox, &MainView); | ||
if(DoButton_CheckBox(&g_Config.m_ClChillerbotHud, "show component hud", g_Config.m_ClChillerbotHud, &Checkbox)) | ||
{ | ||
g_Config.m_ClChillerbotHud ^= 1; | ||
m_pClient->m_ChillerBotUX.UpdateComponents(); | ||
} | ||
} | ||
// war list | ||
{ | ||
CUIRect Checkbox; | ||
MainView.HSplitTop(20.0f, &Checkbox, &MainView); | ||
if(DoButton_CheckBox(&g_Config.m_ClWarList, "war list", g_Config.m_ClWarList, &Checkbox)) | ||
{ | ||
g_Config.m_ClWarList ^= 1; | ||
m_pClient->m_ChillerBotUX.UpdateComponents(); | ||
m_pClient->m_WarList.ReloadList(); | ||
} | ||
} | ||
// notify tile change | ||
{ | ||
CUIRect Checkbox; | ||
MainView.HSplitTop(20.0f, &Checkbox, &MainView); | ||
if(DoButton_CheckBox(&g_Config.m_ClChangeTileNotification, "notify when tee leaves current tile type (while tabbed out)", g_Config.m_ClChangeTileNotification, &Checkbox)) | ||
{ | ||
g_Config.m_ClChangeTileNotification ^= 1; | ||
} | ||
} | ||
// show last killer | ||
{ | ||
CUIRect Checkbox; | ||
MainView.HSplitTop(20.0f, &Checkbox, &MainView); | ||
if(DoButton_CheckBox(&g_Config.m_ClShowLastKiller, "Show last killer", g_Config.m_ClShowLastKiller, &Checkbox)) | ||
{ | ||
g_Config.m_ClShowLastKiller ^= 1; | ||
g_Config.m_ClChillerbotHud = 1; | ||
m_pClient->m_ChillerBotUX.UpdateComponents(); | ||
} | ||
} | ||
// render laser head | ||
{ | ||
CUIRect Checkbox; | ||
MainView.HSplitTop(20.0f, &Checkbox, &MainView); | ||
if(DoButton_CheckBox(&g_Config.m_ClRenderLaserHead, "Render laser heads (bobbles)", g_Config.m_ClRenderLaserHead, &Checkbox)) | ||
g_Config.m_ClRenderLaserHead ^= 1; | ||
} | ||
// skin stealer | ||
{ | ||
CUIRect Checkbox; | ||
MainView.HSplitTop(20.0f, &Checkbox, &MainView); | ||
if(DoButton_CheckBox(&g_Config.m_ClSkinStealer, "Skin stealer", g_Config.m_ClSkinStealer, &Checkbox)) | ||
{ | ||
str_format(aBuf, sizeof(aBuf), "cl_skin_stealer %d", !g_Config.m_ClSkinStealer); | ||
Console()->ExecuteLine(aBuf); | ||
} | ||
} | ||
// Playtime | ||
{ | ||
MainView.HSplitTop(20.0f, &Button, &MainView); | ||
Button.VSplitLeft(120.0f, &Label, &Button); | ||
str_format(aBuf, sizeof(aBuf), "chillerbot-ux playtime: %d hours", m_pClient->m_ChillerBotUX.GetPlayTimeHours()); | ||
Ui()->DoLabel(&Label, aBuf, 14.0f, -1); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters