3 protected ItemBase m_WritingImplement;
6 protected string m_SimpleText;
15 Param1<string> param =
new Param1<string>(
"");
18 if (rpc_type ==
ERPCs.RPC_WRITE_NOTE)
22 SetNoteText(param.param1);
31 if (GetNoteInfo(pen,paper))
33 g_Game.GetMission().GetNoteMenu().InitNoteWrite(paper,pen,m_SimpleText);
37 if (rpc_type ==
ERPCs.RPC_WRITE_NOTE_CLIENT)
41 string old_string = m_SimpleText;
42 SetNoteText(param.param1);
43 DepleteWritingImplement(m_WritingImplement,old_string,m_SimpleText);
46 if (rpc_type ==
ERPCs.RPC_READ_NOTE)
50 SetNoteText(param.param1);
54 g_Game.GetMission().GetNoteMenu().InitNoteRead(m_SimpleText);
60 m_WritingImplement = pen;
67 pen = m_WritingImplement;
78 void SetNoteText(
string text)
80 m_SimpleText = MiscGameplayFunctions.SanitizeString(text);
83 void DepleteWritingImplement(notnull
ItemBase pen,
string old_text,
string new_text)
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));