Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс WrittenNoteData

Защищенные члены

void WrittenNoteData (ItemBase parent)
 
void OnRPC (PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
 
void InitNoteInfo (ItemBase pen=null, ItemBase paper=null)
 
bool GetNoteInfo (out ItemBase pen, out ItemBase paper)
 
string GetNoteText ()
 
void SetNoteText (string text)
 
void DepleteWritingImplement (notnull ItemBase pen, string old_text, string new_text)
 

Защищенные данные

ItemBase m_WritingImplement
 
ItemBase m_Paper
 
string m_SimpleText
 

Подробное описание

Конструктор(ы)

◆ WrittenNoteData()

void WrittenNoteData ( ItemBase parent)
inlineprotected
9 {
10
11 }

Методы

◆ DepleteWritingImplement()

void DepleteWritingImplement ( notnull ItemBase pen,
string old_text,
string new_text )
inlineprotected
84 {
85 float qty_per_char = 1.0;
86 float decrease = Math.Clamp((new_text.Length() - old_text.Length()),0,pen.GetQuantityMax());
87 pen.AddQuantity(-(qty_per_char * decrease));
88 }
Definition EnMath.c:7
Definition EntityAI.c:95
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.

Перекрестные ссылки Math::Clamp().

Используется в OnRPC().

◆ GetNoteInfo()

bool GetNoteInfo ( out ItemBase pen,
out ItemBase paper )
inlineprotected
66 {
68 paper = m_Paper;
69 //handwriting = m_Handwriting;
70 return pen && paper;
71 }
ItemBase m_WritingImplement
Definition WrittenNoteData.c:3
ItemBase m_Paper
Definition WrittenNoteData.c:4

Перекрестные ссылки m_Paper и m_WritingImplement.

Используется в OnRPC().

◆ GetNoteText()

string GetNoteText ( )
inlineprotected
74 {
75 return m_SimpleText;
76 }
string m_SimpleText
Definition WrittenNoteData.c:6

Перекрестные ссылки m_SimpleText.

◆ InitNoteInfo()

void InitNoteInfo ( ItemBase pen = null,
ItemBase paper = null )
inlineprotected
59 {
61 m_Paper = paper;
62 //m_Handwriting = handwriting;
63 }

Перекрестные ссылки m_Paper и m_WritingImplement.

◆ OnRPC()

void OnRPC ( PlayerIdentity sender,
int rpc_type,
ParamsReadContext ctx )
inlineprotected
14 {
16
17 //sent from server, executed on client
18 if (rpc_type == ERPCs.RPC_WRITE_NOTE)
19 {
20 if (ctx.Read(param))
21 {
22 SetNoteText(param.param1);
23 }
24
25 g_Game.GetMission().SetNoteMenu(g_Game.GetUIManager().EnterScriptedMenu(MENU_NOTE, GetGame().GetUIManager().GetMenu())); //NULL means no parent
26
29 //int handwriting;
30
32 {
33 g_Game.GetMission().GetNoteMenu().InitNoteWrite(paper,pen,m_SimpleText);
34 }
35 }
36 //sent from client (NoteMenu), executed on server
37 if (rpc_type == ERPCs.RPC_WRITE_NOTE_CLIENT)
38 {
39 if (ctx.Read(param))
40 {
41 string old_string = m_SimpleText;
42 SetNoteText(param.param1);
44 }
45 }
46 if (rpc_type == ERPCs.RPC_READ_NOTE)
47 {
48 if (ctx.Read(param))
49 {
50 SetNoteText(param.param1);
51 }
52
53 g_Game.GetMission().SetNoteMenu(g_Game.GetUIManager().EnterScriptedMenu(MENU_NOTE, GetGame().GetUIManager().GetMenu())); //NULL means no parent
54 g_Game.GetMission().GetNoteMenu().InitNoteRead(m_SimpleText);
55 }
56 }
DayZGame g_Game
Definition DayZGame.c:3746
ERPCs
Definition ERPCs.c:2
Definition InventoryItem.c:731
void DepleteWritingImplement(notnull ItemBase pen, string old_text, string new_text)
Definition WrittenNoteData.c:83
void SetNoteText(string text)
Definition WrittenNoteData.c:78
bool GetNoteInfo(out ItemBase pen, out ItemBase paper)
Definition WrittenNoteData.c:65
proto native CGame GetGame()
const int MENU_NOTE
Definition constants.c:180

Перекрестные ссылки DepleteWritingImplement(), g_Game, GetGame(), GetNoteInfo(), m_SimpleText, m_WritingImplement, MENU_NOTE и SetNoteText().

◆ SetNoteText()

void SetNoteText ( string text)
inlineprotected
79 {
80 m_SimpleText = MiscGameplayFunctions.SanitizeString(text);
81 }

Перекрестные ссылки m_SimpleText.

Используется в OnRPC().

Поля

◆ m_Paper

ItemBase m_Paper
protected

Используется в GetNoteInfo() и InitNoteInfo().

◆ m_SimpleText

string m_SimpleText
protected

Используется в GetNoteText(), OnRPC() и SetNoteText().

◆ m_WritingImplement

ItemBase m_WritingImplement
protected

Используется в GetNoteInfo(), InitNoteInfo() и OnRPC().


Объявления и описания членов класса находятся в файле: