ระบบการแจ้งเตือน (Notification System)
ภาพรวม
ฟังก์ชันสำหรับแสดงการแจ้งเตือนรูปแบบต่างๆ
ที่อยู่ไฟล์
source/client/services/notifications.lua
ฟังก์ชัน
ShowAdvancedNotification
แสดงการแจ้งเตือนขั้นสูงพร้อมไอคอน
sender
string
ชื่อผู้ส่ง
subject
string
หัวข้อข้อความ
msg
string
เนื้อหาข้อความ
textureDict
string
ชื่อของไฟล์รูปภาพ
iconType
string
ชนิดของไอคอน
flash
boolean
ให้ข้อความกระพริบหรือไม่
saveToBrief
boolean
บันทึกข้อความไว้ในสรุปหรือไม่
hudColorIndex
number
รหัสสีของข้อความ
-- ตัวอย่างการใช้งาน
AFUCore.ShowAdvancedNotification(
'SYSTEM', -- sender
'แจ้งเตือน', -- subject
'คุณได้รับ $100', -- msg
'CHAR_BANK_MAZE', -- textureDict
'CHAR_BANK_MAZE', -- iconType
true, -- flash
true, -- saveToBrief
29 -- hudColorIndex (สีเขียว)
)
ShowHelpNotification
แสดงข้อความช่วยเหลือ
msg
string
ข้อความที่ต้องการแสดง
thisFrame
boolean
แสดงเฉพาะเฟรมนี้หรือไม่
beep
boolean
ส่งเสียงเตือนหรือไม่
duration
number
ระยะเวลาแสดง (มิลลิวินาที)
-- ตัวอย่างการใช้งาน
AFUCore.ShowHelpNotification(
'กด ~INPUT_CONTEXT~ เพื่อเก็บไอเทม', -- msg
false, -- thisFrame
true, -- beep
5000 -- duration (5 วินาที)
)
ShowFloatingHelpNotification
แสดงข้อความช่วยเหลือลอยที่ตำแหน่งที่กำหนด
msg
string
ข้อความที่ต้องการแสดง
coords
vector3
พิกัดที่จะแสดงข้อความ
-- ตัวอย่างการใช้งาน
local coords = vector3(100.0, 100.0, 30.0)
AFUCore.ShowFloatingHelpNotification(
'กด E เพื่อเก็บไอเทม',
coords
)
ShowNotification
แสดงการแจ้งเตือนทั่วไป
message
string
ข้อความที่ต้องการแสดง
notifyType
string
ประเภทการแจ้งเตือน (success, info, error, warning)
length
number
ระยะเวลาแสดง (มิลลิวินาที)
title
string
หัวข้อการแจ้งเตือน
position
string
ตำแหน่งที่แสดง (top-left, top-right, bottom-left, bottom-right)
imageExt
string
นามสกุลไฟล์รูปภาพ
rawHtmlOptions
table
ตัวเลือกการแสดงผล HTML
-- ตัวอย่างการใช้งาน
AFUCore.ShowNotification(
'คุณได้รับ $100', -- message
'success', -- notifyType
5000, -- length
'แจ้งเตือน', -- title
'top-right', -- position
'png', -- imageExt
{ -- rawHtmlOptions
title = true,
description = false
}
)
ShowToolTip
แสดงทูลทิปที่ตำแหน่งที่กำหนด
key
string
คีย์อ้างอิงของทูลทิป
msg
string
ข้อความที่ต้องการแสดง
coords
vector3
พิกัดที่จะแสดงทูลทิป
-- ตัวอย่างการใช้งาน
local coords = vector3(100.0, 100.0, 30.0)
AFUCore.ShowToolTip(
'shop_tooltip', -- key
'กด E เพื่อเปิดร้านค้า', -- msg
coords -- coords
)