This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [TUTORIAL] Own server messages in the alert box on login scr  (Read 15689 times)

detonatorss

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 233
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login
« Reply #15 on: February 18, 2015, 01:11:35 pm »
just a little question if i'll try to add a clone of this windows if i made it all how i made to load it in the function?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Desktop


Laptop

osler

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 59
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login
« Reply #16 on: February 18, 2015, 02:32:43 pm »
In AccountLogin.lua modify the following:

Original
Code: [Select]
function AccountLogin_OnEvent(event, arg1, arg2, arg3)
if ( event == "SHOW_SERVER_ALERT" ) then
ServerAlertText:SetText(arg1);
ServerAlertFrame:Show();
elseif ...

Modified:
Code: [Select]
function AccountLogin_OnEvent(event, arg1, arg2, arg3)
if ( event == "SHOW_SERVER_ALERT" ) then
ServerAlertText:SetText(arg1);
ServerAlertFrame:Show();
ServerAlertCustomText:SetText(arg1);
ServerAlertCustomFrame:Show();
elseif ...

This will display the serveralert text in the new frame, but it will be merely a mirror of the original one since the text is piped into the game through the SHOW_SERVER_ALERT event.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

detonatorss

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 233
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login
« Reply #17 on: February 18, 2015, 05:01:46 pm »
i know it like an hour ago i thought it, but it has linked the link of server alert i am  trying to add my new link but is linked into the event the server alert and shos the same as the server alert
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Desktop


Laptop

osler

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 59
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login
« Reply #18 on: February 18, 2015, 10:27:21 pm »
AFAIK it is not possible to have two server alerts, although you may be able to send both serveralerts through the same event as a big string of text and then divide it.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

detonatorss

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 233
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login
« Reply #19 on: February 18, 2015, 11:42:10 pm »
Quote from: "osler"
AFAIK it is not possible to have two server alerts, although you may be able to send both serveralerts through the same event as a big string of text and then divide it.

and how i do it?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Desktop


Laptop

osler

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 59
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login
« Reply #20 on: February 19, 2015, 05:22:43 pm »
Add a marker (=======////======== for example) to separate the articles. Then split the string http://lua-users.org/wiki/SplitJoin using the marker.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

jacburn1

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 19
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login scr
« Reply #21 on: October 05, 2017, 06:22:03 am »
Necro post but you can do a lot more with SimpleHTML than thought of here, just need to format it correctly.

Code: [Select]
SERVERALERT:
<html><body>
<p>Here's a sample of what can be done in the server alert file.

</p>
<p>There's three different header styles:</p>
<br/>
<h1 align="center">This is header style 1</h1>
<h2 align="center">This is header style 2</h2>
<h3 align="center">This is header style 3 (like paragraph style)</h3>
<hr/>
<p align="left">Text can be aligned left,</p>
<p align="center">center,</p>
<p align="right">or to the right!</p>

<img src="Interface/Icons/Ability_Ambush" width="24" height="24" align="right"/>
<img src="Interface/Icons/INV_Misc_Coin_02" width="24" height="24" align="left"/>
<img src="Interface/Icons/INV_Misc_Coin_03" width="24" height="24" align="center"/>

<p>It is |cffff0000also|r |cffff00ffpossible|r to |cff8080ffcolorize|r |cff00ffffthe|r |cff00ff00text|r,</p>
<p>add icons |TInterface/Icons/INV_Misc_Coin_01:16:16:0:0:64:64:4:60:4:60|t to the middle of the text,</p>
<hr/>
<p>You can have links also: <a href="modcraft.io">This link takes you to modcraft</a></p>
</body></html>


Note that img have to be outside of any text formatting and the src has to be part of the WoW Client. Colors and icons mid-text can be done just as with WoW API for escape sequencing since it gets converted to Lua basically in the end anyways, so those work.

Also seems that - while having "SERVERALERT:" inside the <html><body> on 3.3.5a works - later versions (only tested on Legion) require it to be outside of everything and the very first thing in the file.

Figured I'd put this here though since it's really the only topic on this content.
« Last Edit: October 05, 2017, 06:40:29 am by jacburn1 »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login scr
« Reply #22 on: October 05, 2017, 08:55:06 pm »
Thanks for this infos :)
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954