Commit 2af6d19c authored by Dennis Willers's avatar Dennis Willers 🏀

Initial commit

parents
[meta]
name = "Chat-Button-Bar"
author = "RoboTec13"
category = "Race"
version = "1.0"
siteid = 115
[script]
imports = [ "Icons.as", "Formatting.as", "Time.as", "Permissions.as"]
File added
#name "Chat-Button-Bar"
#author "RoboTec13"
#category "Race"
int[] buttonCanNotBePressed;
void Main() {
while(true) {
checkIfButtonsCanNotBeClicked();
yield();
}
}
void checkIfButtonsCanNotBeClicked() {
for (uint i = 0; i < buttonCanNotBePressed.Length; i++) {
resetButtonCanBeClicked(i);
}
}
void resetButtonCanBeClicked(int buttonIndex) {
sleep(1000);
buttonCanNotBePressed.RemoveAt(buttonIndex);
}
$HP7W&c|cI%d䤊 }};풁d"8˶bQ~M
\ No newline at end of file
void RenderMenu()
{
if (UI::MenuItem("\\$0cf" + Icons::FacebookMessenger + "\\$z Chat-Button-Bar", "", Show_Chat_Button_Bar)) {
Show_Chat_Button_Bar = !Show_Chat_Button_Bar;
}
}
\ No newline at end of file
g98ݪ>7{O=X"n}x)L b*ߪso>tcVyɖ 
\ No newline at end of file
// Chat
[Setting category="Window" name="Show Chat-Button-Bar"]
bool Show_Chat_Button_Bar = true;
[Setting category="Window" name="Position X / Position Y"]
vec2 Setting_View_Chat_Pos = vec2(0, Setting_View_Height-34);
int Setting_View_Height = Draw::GetHeight();
[Setting category="Window" name="Button Color"]
vec4 Setting_View_Chat_Button_Color = vec4(0.2,0.3,0.75,1);
[Setting category="Window" name="Button Hover Color"]
vec4 Setting_View_Chat_Button_Hover_Color = vec4(0.2,0.3,0.4,1);
[Setting category="Buttons" name="Button 1 Name"]
string Setting_Config_Chat_Button_1 = "hi";
[Setting category="Buttons" name="Button 1 Text"]
string Setting_Config_Chat_Text_1 = "$00CHe$01Dll$02Eo W$03For$03Fl$04Fd$16F!$17F $28F:$29F)$3BF $3CF🌐";
[Setting category="Buttons" name="Button 2 Name"]
string Setting_Config_Chat_Button_2 = "bb";
[Setting category="Buttons" name="Button 2 Text"]
string Setting_Config_Chat_Text_2 = "$C0FB$D0By$E08e$E04 $F00B$F00y$F31e$F62 $F93🏃";
[Setting category="Buttons" name="Button 3 Name"]
string Setting_Config_Chat_Button_3 = "gl&hf";
[Setting category="Buttons" name="Button 3 Text"]
string Setting_Config_Chat_Text_3 = "$F00Go$E00od$D00 Lu$C00ck$B00 &$B00 H$C00av$D00e F$E00un$F00 🎮";
[Setting category="Buttons" name="Button 4 Name"]
string Setting_Config_Chat_Button_4 = "nt";
[Setting category="Buttons" name="Button 4 Text"]
string Setting_Config_Chat_Text_4 = "$FF0N$FF1i$FF2c$FF4e$FF5 $FF6T$FF6i$FF8m$FFAe$FFB!$FFD $FFF⏰";
[Setting category="Buttons" name="Button 5 Name"]
string Setting_Config_Chat_Button_5 = "wow";
[Setting category="Buttons" name="Button 5 Text"]
string Setting_Config_Chat_Text_5 = "$F00W$F31o$F52o$F83o$FA4o$FD5O$FF6O$FF6o$FE8O$FC9O$FBBo$F9Co$F8EW$F6F👤";
[Setting category="Buttons" name="Button 6 Name"]
string Setting_Config_Chat_Button_6 = "gr";
[Setting category="Buttons" name="Button 6 Text"]
string Setting_Config_Chat_Text_6 = "$6F3G$5F4o$4F5o$3F6d$2F7 $1F8R$0F9o$0F9u$1F8n$1F7d$2F5!$2F4 $3F3🏁";
[Setting category="Buttons" name="Button 7 Name"]
string Setting_Config_Chat_Button_7 = "gg";
[Setting category="Buttons" name="Button 7 Text"]
string Setting_Config_Chat_Text_7 = "$F00G$F21o$F41o$F52d$F72 $F93G$F93a$FA2m$FB2e$FD1!$FE1 $FF0🏆";
[Setting category="Buttons" name="Button 8 Name"]
string Setting_Config_Chat_Button_8 = "ty";
[Setting category="Buttons" name="Button 8 Text"]
string Setting_Config_Chat_Text_8 = "$a00T$b00h$c00a$d00n$e00k $f00Y$e00o$d00u$c00!";
[Setting category="Buttons" name="Button 9 Name"]
string Setting_Config_Chat_Button_9 = "bonk";
[Setting category="Buttons" name="Button 9 Text"]
string Setting_Config_Chat_Text_9 = "$F0FB$E0Eo$C0Dn$B0Ck$90Bs$80B $60Ae$509v$308e$207r$006y$006w$106h$205e$405r$505e$605 $704-$804_$A04-$B03 $F64🔥";
[Setting category="Buttons" name="Button 10 Name"]
string Setting_Config_Chat_Button_10 = "cbb";
[Setting category="Buttons" name="Button 10 Text"]
string Setting_Config_Chat_Text_10 = "$93FJus$83Ft pre$72Fss a $62Fbutto$52Fn and$41F thi$31Fs ama$21Fzing $10Ftext $00Fsho$00Fws$10F up$20F in$31F th$41Fe $51Fcha$61Ft.$C00♥ $71FDow$82Fnlo$92Fad $A2Fthe$B2F p$C2Flug$D3Fin $E3Fher$F3Fe: $cc0$lhttps://openplanet.nl/files/115";
[Setting category="Buttons" name="Button 11 Name"]
string Setting_Config_Chat_Button_11 = "";
[Setting category="Buttons" name="Button 11 Text"]
string Setting_Config_Chat_Text_11 = "";
[Setting category="Buttons" name="Button 12 Name"]
string Setting_Config_Chat_Button_12 = "";
[Setting category="Buttons" name="Button 12 Text"]
string Setting_Config_Chat_Text_12 = "";
[Setting category="Buttons" name="Button 13 Name"]
string Setting_Config_Chat_Button_13 = "";
[Setting category="Buttons" name="Button 13 Text"]
string Setting_Config_Chat_Text_13 = "";
[Setting category="Buttons" name="Button 14 Name"]
string Setting_Config_Chat_Button_14 = "";
[Setting category="Buttons" name="Button 14 Text"]
string Setting_Config_Chat_Text_14 = "";
[Setting category="Buttons" name="Button 15 Name"]
string Setting_Config_Chat_Button_15 = "";
[Setting category="Buttons" name="Button 15 Text"]
string Setting_Config_Chat_Text_15 = "";
[Setting category="Buttons" name="Button 16 Name"]
string Setting_Config_Chat_Button_16 = "";
[Setting category="Buttons" name="Button 16 Text"]
string Setting_Config_Chat_Text_16 = "";
[Setting category="Buttons" name="Button 17 Name"]
string Setting_Config_Chat_Button_17 = "";
[Setting category="Buttons" name="Button 17 Text"]
string Setting_Config_Chat_Text_17 = "";
[Setting category="Buttons" name="Button 18 Name"]
string Setting_Config_Chat_Button_18 = "";
[Setting category="Buttons" name="Button 18 Text"]
string Setting_Config_Chat_Text_18 = "";
[Setting category="Buttons" name="Button 19 Name"]
string Setting_Config_Chat_Button_19 = "";
[Setting category="Buttons" name="Button 19 Text"]
string Setting_Config_Chat_Text_19 = "";
[Setting category="Buttons" name="Button 20 Name"]
string Setting_Config_Chat_Button_20 = "";
[Setting category="Buttons" name="Button 20 Text"]
string Setting_Config_Chat_Text_20 = "";
\ No newline at end of file
k }_#PK&X, \Dx}ALL͞X}QFcQ@
\ No newline at end of file
#name "Chat-Button-Bar"
#author "RoboTec13"
#category "Race"
void RenderInterface() {
if (Permissions::InGameChat()) {
// hide if unwanted
if (Show_Chat_Button_Bar && getTmApp().RootMap !is null && isServer()) {
if (Setting_View_Chat_Pos.y <= 0) {
Setting_View_Height = Draw::GetHeight();
Setting_View_Chat_Pos = vec2(Setting_View_Chat_Pos.x, Setting_View_Height + Setting_View_Chat_Pos.y);
}
UI::PushStyleColor(UI::Col::WindowBg, vec4(0,0,0,0));
UI::PushStyleColor(UI::Col::Button, Setting_View_Chat_Button_Color);
UI::PushStyleColor(UI::Col::ButtonHovered, Setting_View_Chat_Button_Hover_Color);
UI::Begin("Chat", UI::WindowFlags::NoCollapse | UI::WindowFlags::AlwaysAutoResize | UI::WindowFlags::NoTitleBar);
UI::SetWindowPos(Setting_View_Chat_Pos);
createButton(Setting_Config_Chat_Button_1, 1);
createButton(Setting_Config_Chat_Button_2, 2);
createButton(Setting_Config_Chat_Button_3, 3);
createButton(Setting_Config_Chat_Button_4, 4);
createButton(Setting_Config_Chat_Button_5, 5);
createButton(Setting_Config_Chat_Button_6, 6);
createButton(Setting_Config_Chat_Button_7, 7);
createButton(Setting_Config_Chat_Button_8, 8);
createButton(Setting_Config_Chat_Button_9, 9);
createButton(Setting_Config_Chat_Button_10, 10);
createButton(Setting_Config_Chat_Button_11, 11);
createButton(Setting_Config_Chat_Button_12, 12);
createButton(Setting_Config_Chat_Button_13, 13);
createButton(Setting_Config_Chat_Button_14, 14);
createButton(Setting_Config_Chat_Button_15, 15);
createButton(Setting_Config_Chat_Button_16, 16);
createButton(Setting_Config_Chat_Button_17, 17);
createButton(Setting_Config_Chat_Button_18, 18);
createButton(Setting_Config_Chat_Button_19, 19);
createButton(Setting_Config_Chat_Button_20, 20);
UI::End();
UI::PopStyleColor();
UI::PopStyleColor();
UI::PopStyleColor();
}
}
}
void createButton(string buttonName, int buttonNumber) {
if (buttonName != "") {
if (UI::Button(buttonName) && checkIfButtonCanPressed(buttonNumber)) {
sendMessage(buttonNumber);
}
UI::SameLine();
}
}
void sendMessage(int buttonNumber) {
CSmArenaClient@ playground = cast<CSmArenaClient>(cast<CTrackMania>(GetApp()).CurrentPlayground);
CGamePlaygroundInterface@ playgroundInterface = cast<CGamePlaygroundInterface>(playground.Interface);
switch(buttonNumber) {
case 1: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_1; return;
case 2: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_2; return;
case 3: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_3; return;
case 4: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_4; return;
case 5: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_5; return;
case 6: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_6; return;
case 7: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_7; return;
case 8: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_8; return;
case 9: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_9; return;
case 10: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_10; return;
case 11: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_11; return;
case 12: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_12; return;
case 13: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_13; return;
case 14: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_14; return;
case 15: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_15; return;
case 16: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_16; return;
case 17: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_17; return;
case 18: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_18; return;
case 19: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_19; return;
case 20: playgroundInterface.ChatEntry = Setting_Config_Chat_Text_20; return;
}
}
bool checkIfButtonCanPressed(int buttonNumber) {
for (uint i = 0; i < buttonCanNotBePressed.Length; i++) {
if (buttonCanNotBePressed[i] == buttonNumber) {
return false;
}
}
buttonCanNotBePressed.InsertLast(buttonNumber);
return true;
}
ߡj<npSeEˬD_RuYd<dbfy`g rg&kw
\ No newline at end of file
CTrackMania@ getTmApp() {
return cast<CTrackMania>(GetApp());
}
CGameCtnNetwork@ getNetwork() {
return getTmApp().Network;
}
CGameNetServerInfo@ getServerInfo() {
if (getNetwork() !is null) return getNetwork().ServerInfo;
return null;
}
bool isServer() {
return (getServerInfo() !is null && getServerInfo().ServerHostName != "");
}
n9l@8ґ"P3C0б{#i4׊yPb빣w\>V{
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment